Skip to content

Commit

Permalink
[dhcp-relay] Fix dhcp6relay counter issue (#2866)
Browse files Browse the repository at this point in the history
Why I did
While deleting a Vlan, clear dhcpv6_relay counter info state_db before dhcp_relay container restart would cause that counter info still exist in state_db, which is incorrect.
Microsoft ADO number: 24211173

How I did it
Clear counter info in state_db after container restart.

How to verify it
Previous ut and build image to verify.

Signed-off-by: Yaqiang Zhu <yaqiangzhu@microsoft.com>
  • Loading branch information
yaqiangz committed Jun 12, 2023
1 parent 0f67ab7 commit dbcaaf8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions config/vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,14 @@ def del_vlan(db, vid, no_restart_dhcp_relay):
# set dhcpv4_relay table
set_dhcp_relay_table('VLAN', config_db, vlan, None)

delete_state_db_entry(vlan)

if not no_restart_dhcp_relay and is_dhcpv6_relay_config_exist(db, vlan):
# set dhcpv6_relay table
set_dhcp_relay_table('DHCP_RELAY', config_db, vlan, None)
# We need to restart dhcp_relay service after dhcpv6_relay config change
if is_dhcp_relay_running():
dhcp_relay_util.handle_restart_dhcp_relay_service()

delete_state_db_entry(vlan)

vlans = db.cfgdb.get_keys('VLAN')
if not vlans:
docker_exec_cmd = "docker exec -i swss {}"
Expand Down

0 comments on commit dbcaaf8

Please sign in to comment.