From 7924bd18d45547d6c865a42315766bc2324f7eec Mon Sep 17 00:00:00 2001 From: lguohan Date: Mon, 28 Dec 2020 03:06:53 -0800 Subject: [PATCH] [route_check]: ignore routes pointing to Loopback interface (#1337) orchagent ignore all routes pointing to Loopback interfaces. add this skip logic in route check. https://github.com/Azure/sonic-swss/pull/1570 Signed-off-by: Guohan Lu --- scripts/route_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/route_check.py b/scripts/route_check.py index 09b9505d0a..3bb47a2643 100755 --- a/scripts/route_check.py +++ b/scripts/route_check.py @@ -166,7 +166,7 @@ def get_interfaces(): def filter_out_local_interfaces(keys): rt = [] - local_if = set(['eth0', 'lo', 'docker0']) + local_if_re = ['eth0', 'lo', 'docker0', 'Loopback\d+'] db = ConfigDBConnector() db.db_connect('APPL_DB') @@ -176,7 +176,7 @@ def filter_out_local_interfaces(keys): if not e: # Prefix might have been added. So try w/o it. e = db.get_entry('ROUTE_TABLE', k.split("/")[0]) - if not e or (e['ifname'] not in local_if): + if not e or all([not re.match(x, e['ifname']) for x in local_if_re]): rt.append(k) return rt