Skip to content

Commit 04ce7be

Browse files
authored
check state_db for po before sending ARP/ND pkts (#2444) (#2450)
Signed-off-by: Vivek Reddy Karri <[email protected]> Check STATE_DB before sending ARP/ND pkts for neighbors associated with PortChannel. As a part of intf check, wait for the LAG_MEMBER_TABLE to be populated for Portchannels ifaces
1 parent f0138a2 commit 04ce7be

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

neighsyncd/restore_neighbors.py

+19-11
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,29 @@ def is_intf_oper_state_up(intf):
8181
return True
8282
return False
8383

84-
def is_intf_up(intf, db):
85-
if not is_intf_oper_state_up(intf):
86-
return False
84+
def check_state_db(intf, db):
85+
table_name = ''
8786
if 'Vlan' in intf:
8887
table_name = 'VLAN_MEMBER_TABLE|{}|*'.format(intf)
89-
key = db.keys(db.STATE_DB, table_name)
90-
if key is None:
91-
log_info ("Vlan member is not yet created")
92-
return False
93-
if is_intf_up.counter == 0:
94-
time.sleep(3*CHECK_INTERVAL)
95-
is_intf_up.counter = 1
96-
log_info ("intf {} is up".format(intf))
88+
elif 'PortChannel' in intf:
89+
table_name = 'LAG_MEMBER_TABLE|{}|*'.format(intf)
90+
else:
91+
return True
92+
key = db.keys(db.STATE_DB, table_name)
93+
if key is None:
94+
log_info ("members for {} are not yet created".format(intf))
95+
return False
96+
if is_intf_up.counter == 0:
97+
time.sleep(3*CHECK_INTERVAL)
98+
is_intf_up.counter = 1
99+
log_info ("intf {} is up".format(intf))
97100
return True
98101

102+
def is_intf_up(intf, db):
103+
if not is_intf_oper_state_up(intf):
104+
return False
105+
return check_state_db(intf, db)
106+
99107
# read the neigh table from AppDB to memory, format as below
100108
# build map as below, this can efficiently access intf and family groups later
101109
# { intf1 -> { { family1 -> [[ip1, mac1], [ip2, mac2] ...] }

0 commit comments

Comments
 (0)