From 9cc4b7b40636d892af90e684fb06ee7337af9d3e Mon Sep 17 00:00:00 2001 From: Longxiang Lyu <35479537+lolyu@users.noreply.github.com> Date: Sat, 7 Aug 2021 12:14:18 +0800 Subject: [PATCH] [swss][arp_update] Send ipv6 pings over vlan sub interfaces (#8363) #### Why I did it * `arp_update` fails to ping those neighbors over vlan sub interfaces. #### How I did it * modify `arp_update_vars.j2` to get vlan sub interfaces with ipv6 addresses assigned. * modify `arp_update` to send ipv6 pings over those retrieved vlan sub interfaces. Signed-off-by: Longxiang Lyu --- files/build_templates/arp_update_vars.j2 | 1 + files/scripts/arp_update | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/files/build_templates/arp_update_vars.j2 b/files/build_templates/arp_update_vars.j2 index b9315b5ebe..3cdfa81023 100644 --- a/files/build_templates/arp_update_vars.j2 +++ b/files/build_templates/arp_update_vars.j2 @@ -1,5 +1,6 @@ { "interface": "{% for (name, prefix) in INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "pc_interface" : "{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", + "vlan_sub_interface": "{% for (name, prefix) in VLAN_SUB_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "vlan" : "{% if VLAN %}{{ VLAN.keys() | join(' ') }}{% endif %}" } diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 2fec40c14b..1d4cf1ec54 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -14,8 +14,9 @@ while /bin/true; do ARP_UPDATE_VARS=$(sonic-cfggen -d -t ${ARP_UPDATE_VARS_FILE}) INTERFACE=$(echo $ARP_UPDATE_VARS | jq -r '.interface') PC_INTERFACE=$(echo $ARP_UPDATE_VARS | jq -r '.pc_interface') + VLAN_SUB_INTERFACE=$(echo $ARP_UPDATE_VARS | jq -r '.vlan_sub_interface') - ALL_INTERFACE="$INTERFACE $PC_INTERFACE" + ALL_INTERFACE="$INTERFACE $PC_INTERFACE $VLAN_SUB_INTERFACE" for intf in $ALL_INTERFACE; do ping6cmd="ping6 -I $intf -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null" intf_up=$(ip link show $intf | grep "state UP")