Skip to content

Commit

Permalink
[warmboot finalizer] load dhcpv6 copp rules when missing (#9048)
Browse files Browse the repository at this point in the history
Why I did it
Need to enable DHCPv6 COPP rules.

How I did it
Load the separate DHCPv6 COPP rules after warm reboot if the rules are missing.

How to verify it
Warm reboot from an image doesn't have DHCPv6 COPP rules installed.
Warm reboot from an image have DHCPv6 COPP rules already installed.
In either case, the script did the right thing and only install the COPP rules if it is missing.

Signed-off-by: Ying Xie ying.xie@microsoft.com
  • Loading branch information
yxieca authored Oct 25, 2021
1 parent 7e4aa6a commit 6483bf4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions files/image_config/warmboot-finalizer/finalize-warmboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ function stop_control_plane_assistant()
fi
}

function load_dhcpv6_copp_rules()
{
KEY="COPP_TABLE:trap.group.dhcpv6"
RULE=$(redis-cli -n 0 keys "${KEY}")
if [[ -n "${RULE}" ]]; then
debug "${KEY} already exist, skip reloading..."
else
debug "${KEY} not found, reloading..."
docker exec -t swss swssconfig /etc/swss/config.d/01-copp-dhcpv6.config.json
fi
}


wait_for_database_service

Expand Down Expand Up @@ -107,4 +119,5 @@ if [[ -n "${list}" ]]; then
debug "Some components didn't finish reconcile: ${list} ..."
fi

load_dhcpv6_copp_rules
finalize_warm_boot

0 comments on commit 6483bf4

Please sign in to comment.