File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -46,5 +46,26 @@ while /bin/true; do
46
46
ip6cmd=" ip -6 neigh show | grep -v fe80 | grep $vlan | cut -d ' ' -f 1,3 | $ndisc6cmd "
47
47
eval ` eval $ip6cmd `
48
48
done
49
+
50
+ # refresh neighbor entries from APP_DB in case of mismatch with kernel
51
+ DBNEIGH=$( sonic-db-cli APPL_DB keys NEIGH_TABLE* )
52
+ KERNEIGH4=$( ip -4 neigh show | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=' ,' )
53
+ KERNEIGH6=$( ip -6 neigh show | grep -v fe80 | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=' ,' )
54
+ for neigh in $DBNEIGH ; do
55
+ intf=" $( cut -d ' :' -f 2 <<< " $neigh" ) "
56
+ ip=" $( cut -d ' :' -f 3- <<< " $neigh" ) "
57
+ if [[ $intf == * " Vlan" * ]]; then
58
+ if [[ $ip == * " ." * ]] && [[ ! $KERNEIGH4 =~ " ${ip} ,${intf} " ]]; then
59
+ pingcmd=" timeout 0.2 ping -I $intf -n -q -i 0 -c 1 -W 1 $ip >/dev/null"
60
+ eval $pingcmd
61
+ logger " arp_update: mismatch arp entry, pinging ${ip} on ${intf} "
62
+ elif [[ $ip == * " :" * ]] && [[ ! $KERNEIGH6 =~ " ${ip} ,${intf} " ]]; then
63
+ ping6cmd=" timeout 0.2 ping6 -I $intf -n -q -i 0 -c 1 -W 1 $ip >/dev/null"
64
+ eval $ping6cmd
65
+ logger " arp_update: mismatch v6 nbr entry, pinging ${ip} on ${intf} "
66
+ fi
67
+ fi
68
+ done
69
+
49
70
sleep 300
50
71
done
You can’t perform that action at this time.
0 commit comments