From 13fef742af86d12b952ecc800f31fff1d6e38071 Mon Sep 17 00:00:00 2001 From: anish-n Date: Wed, 10 May 2023 11:02:48 -0700 Subject: [PATCH] Resolve neighbors from config_db --- files/scripts/arp_update | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 2725f034668b..4b25973cfc02 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -124,8 +124,12 @@ while /bin/true; do # refresh neighbor entries from APP_DB in case of mismatch with kernel DBNEIGH=$(sonic-db-cli APPL_DB keys NEIGH_TABLE*) - KERNEIGH4=$(ip -4 neigh show | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=',') - KERNEIGH6=$(ip -6 neigh show | grep -v fe80 | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=',') + + # resolve neighbor entries from CONFIG_DB in case of mismatch with kernel + DBNEIGH="$DBNEIGH $(sonic-db-cli CONFIG_DB keys NEIGH* | sed -e 's/|/:/g')" + + KERNEIGH4=$(ip -4 neigh show | grep Vlan | grep -v 'FAILED\|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',') + KERNEIGH6=$(ip -6 neigh show | grep -v fe80 | grep Vlan | grep -v 'FAILED\|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',') for neigh in $DBNEIGH; do intf="$( cut -d ':' -f 2 <<< "$neigh" )" ip="$( cut -d ':' -f 3- <<< "$neigh" )"