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 3662ee7 commit 6da6f6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dump/plugins/copp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
"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",
"vrrpv6": "SAI_HOSTIF_TRAP_TYPE_VRRPV6",
"bgpv6": "SAI_HOSTIF_TRAP_TYPE_BGPV6",
Expand Down
2 changes: 1 addition & 1 deletion tests/dump_input/copp_cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"trap_group": "queue4_group3"
},
"dhcp": {
"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/dump_tests/module_tests/copp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,6 @@ def test_all_args(self, match_engine):
params = {}
m_copp = Copp(match_engine)
returned = m_copp.get_all_args("")
expect = ["bgp", "bgpv6", "lacp", "arp_req", "arp_resp", "neigh_discovery", "lldp", "dhcp", "dhcpv6", "udld", "ip2me", "src_nat_miss", "dest_nat_miss", "sample_packet", "snmp", "bfd", "vrrpv6", "ospf", "ospfv6"]
expect = ["bgp", "bgpv6", "lacp", "arp_req", "arp_resp", "neigh_discovery", "lldp", "dhcp", "dhcp_l2", "dhcpv6", "dhcpv6_l2", "udld", "ip2me", "src_nat_miss", "dest_nat_miss", "sample_packet", "snmp", "bfd", "vrrpv6", "ospf", "ospfv6"]
ddiff = DeepDiff(expect, returned, ignore_order=True)
assert not ddiff, ddiff

0 comments on commit 6da6f6d

Please sign in to comment.