Skip to content

Commit

Permalink
Add CoPP trap for DHCP L2 broadcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasstockner committed Dec 1, 2023
1 parent bd74cba commit 002c205
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions orchagent/copporch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ static map<string, sai_hostif_trap_type_t> trap_id_map = {
{"arp_req", SAI_HOSTIF_TRAP_TYPE_ARP_REQUEST},
{"arp_resp", SAI_HOSTIF_TRAP_TYPE_ARP_RESPONSE},
{"dhcp", SAI_HOSTIF_TRAP_TYPE_DHCP},
{"dhcp_l2", SAI_HOSTIF_TRAP_TYPE_DHCP_L2},
{"ospf", SAI_HOSTIF_TRAP_TYPE_OSPF},
{"pim", SAI_HOSTIF_TRAP_TYPE_PIM},
{"vrrp", SAI_HOSTIF_TRAP_TYPE_VRRP},
{"bgp", SAI_HOSTIF_TRAP_TYPE_BGP},
{"dhcpv6", SAI_HOSTIF_TRAP_TYPE_DHCPV6},
{"dhcpv6_l2", SAI_HOSTIF_TRAP_TYPE_DHCPV6_L2},
{"ospfv6", SAI_HOSTIF_TRAP_TYPE_OSPFV6},
{"isis", SAI_HOSTIF_TRAP_TYPE_ISIS},
{"vrrpv6", SAI_HOSTIF_TRAP_TYPE_VRRPV6},
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_tests/copp_cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"trap_group": "queue4_group3"
},
"dhcp_relay": {
"trap_ids": "dhcp,dhcpv6",
"trap_ids": "dhcp,dhcp_l2,dhcpv6,dhcpv6_l2",
"trap_group": "queue4_group3"
},
"udld": {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_copp.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"lacp": ["lacp", copp_group_queue4_group1, "always_enabled"],
"arp": ["arp_req;arp_resp;neigh_discovery", copp_group_queue4_group2, "always_enabled"],
"lldp": ["lldp", copp_group_queue4_group3],
"dhcp": ["dhcp;dhcpv6", copp_group_queue4_group3],
"dhcp": ["dhcp;dhcp_l2;dhcpv6;dhcpv6_l2", copp_group_queue4_group3],
"udld": ["udld", copp_group_queue4_group3, "always_enabled"],
"ip2me": ["ip2me", copp_group_queue1_group1, "always_enabled"],
"nat": ["src_nat_miss;dest_nat_miss", copp_group_queue1_group2],
Expand Down

0 comments on commit 002c205

Please sign in to comment.