Skip to content

Commit

Permalink
[dhcpmon] Fix dhcpmon socket filter and tx count issue (#13065)
Browse files Browse the repository at this point in the history
Why I did it
Fix issue caused by dualtor support PR [dhcpmon] Open different socket for dual tor to enable interface filtering #11201
Improve code
How I did it
On single ToR, packets received count was duplicated due to socket filter set to "inbound"
Tx count not increasing due to filter set to "inbound". Added an outbound socket to count tx packets
Added vlan member interface mapping for Ethernet interface to vlan interface lookup in reference to PR Fix multiple vlan issue sonic-dhcp-relay#27
Exit when socket fails to initialize to allow dhcp_relay docker to restart
How to verify it
Tested on vstestbed single tor and dual tor, sent packets and verify printed out dhcpmon rx and tx counters is correct

Correct number of tx increases
Tx does not increase when ToR is on standby
  • Loading branch information
kellyyeh authored and mssonicbld committed Feb 4, 2023
1 parent b4e22e2 commit f4ae621
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 141 deletions.
Loading

0 comments on commit f4ae621

Please sign in to comment.