Skip to content

Commit 7924bd1

Browse files
authored
[route_check]: ignore routes pointing to Loopback interface (#1337)
orchagent ignore all routes pointing to Loopback interfaces. add this skip logic in route check. sonic-net/sonic-swss#1570 Signed-off-by: Guohan Lu <lguohan@gmail.com>
1 parent de14939 commit 7924bd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/route_check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def get_interfaces():
166166

167167
def filter_out_local_interfaces(keys):
168168
rt = []
169-
local_if = set(['eth0', 'lo', 'docker0'])
169+
local_if_re = ['eth0', 'lo', 'docker0', 'Loopback\d+']
170170

171171
db = ConfigDBConnector()
172172
db.db_connect('APPL_DB')
@@ -176,7 +176,7 @@ def filter_out_local_interfaces(keys):
176176
if not e:
177177
# Prefix might have been added. So try w/o it.
178178
e = db.get_entry('ROUTE_TABLE', k.split("/")[0])
179-
if not e or (e['ifname'] not in local_if):
179+
if not e or all([not re.match(x, e['ifname']) for x in local_if_re]):
180180
rt.append(k)
181181

182182
return rt

0 commit comments

Comments
 (0)