History

netfilter: ebtables: add support for matching ICMP type and code

We already have ICMPv6 type/code matches. This adds support for IPv4 ICMP matches in the same way.

Matthias Schiffer committed 8 years ago

Commit 5adc1661 parent 20710b32 files · +43 −13Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/netfilter_bridge/ebt_ip.h+10−3
@@ -24,8 +24,9 @@ · 23 unmodified lines
2424 #define EBT_IP_PROTO 0x08
2525 #define EBT_IP_SPORT 0x10
2626 #define EBT_IP_DPORT 0x20
27+#define EBT_IP_ICMP 0x40
2728 #define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\
28− EBT_IP_SPORT | EBT_IP_DPORT )
29+ EBT_IP_SPORT | EBT_IP_DPORT | EBT_IP_ICMP)
2930 #define EBT_IP_MATCH "ip"
3031
3132 /* the same values are used for the invflags */
@@ -38,8 +39,14 @@ struct ebt_ip_info { · 6 unmodified lines
3839 __u8 protocol;
3940 __u8 bitmask;
4041 __u8 invflags;
41− __u16 sport[2];
42− __u16 dport[2];
42+ union {
43+ __u16 sport[2];
44+ __u8 icmp_type[2];
45+ };
46+ union {
47+ __u16 dport[2];
48+ __u8 icmp_code[2];
49+ };
4350 };
4451
4552 #endif