netfilter: ebt_ip6: allow matching on ipv6-icmp types/codes
Subsystems (3)
Florian Westphal
maintainerPATCH v2 1/1 netfilter: ebt_ip6: allow matching on ipv6-icmp types/codes
To avoid adding a new match revision icmp type/code are stored in the sport/dport area.
---
Changes since v1:
- use u16 where appropriate
- use proper () in if condition
- renamed _ports to _pkthdr
- add comment that sizeof(_pktheader) is also ok in ICMP6 case.
include/linux/netfilter_bridge/ebt_ip6.h | 15 ++++++++-- net/bridge/netfilter/ebt_ip6.c | 46 ++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 15 deletions(-)
include/linux/netfilter_bridge/ebt_ip6.h +12 -3
@@ -18,8 +18,11 @@#define EBT_IP6_PROTO 0x08#define EBT_IP6_SPORT 0x10#define EBT_IP6_DPORT 0x20 +#define EBT_IP6_ICMP6 0x40 +#define EBT_IP6_MASK (EBT_IP6_SOURCE | EBT_IP6_DEST | EBT_IP6_TCLASS |\ - EBT_IP6_PROTO | EBT_IP6_SPORT | EBT_IP6_DPORT) + EBT_IP6_PROTO | EBT_IP6_SPORT | EBT_IP6_DPORT | \ + EBT_IP6_ICMP6)#define EBT_IP6_MATCH "ip6"/* the same values are used for the invflags */
@@ -32,8 +35,14 @@ struct ebt_ip6_info {uint8_t protocol;uint8_t bitmask;uint8_t invflags; -uint16_t sport[2 ]; - uint16_t dport[2]; +union { +uint16_t sport[2 ]; +uint8_t icmpv6_type[2 ]; + }; +union { +uint16_t dport[2 ]; +uint8_t icmpv6_code[2 ]; + }; };#endif
net/bridge/netfilter/ebt_ip6.c +34 -12
83 lines not on this page · raw message
Signature · 1 line
1.7.2.2
Op 20/12/2010 15:57, Florian Westphal schreef:
Quoted 12 lines
To avoid adding a new match revision icmp type/code are stored in the sport/dport area.
Signed-off-by Florian Westphal<[email protected]>Reviewed-by Holger Eitzenberger<[email protected]>---
Changes since v1:
- use u16 where appropriate
- use proper () in if condition
- renamed_portsto_pkthdr
- add comment thatsizeof(_pktheader)is also ok in ICMP6 case.
Quoted 4 lines
include/linux/netfilter_bridge/ebt_ip6.h | 15 ++++++++-- net/bridge/netfilter/ebt_ip6.c | 46 ++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 15 deletions(-)
OK for me.
Quoted 13 lines · Bart De Schuymer
Op 20/12/2010 15:57, Florian Westphal schreef:
Quoted 12 lines
To avoid adding a new match revision icmp type/code are stored in the sport/dport area.
Signed-off-by Florian Westphal<[email protected]>Reviewed-by Holger Eitzenberger<[email protected]>---
Changes since v1:
- use u16 where appropriate
- use proper () in if condition
- renamed_portsto_pkthdr
- add comment thatsizeof(_pktheader)is also ok in ICMP6 case.
Quoted 8 lines
Quoted 5 lines
include/linux/netfilter_bridge/ebt_ip6.h | 15 ++++++++-- net/bridge/netfilter/ebt_ip6.c | 46 ++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 15 deletions(-)OK for me.
Reviewed-by Bart De Schuymer<[email protected]>
Applied, thanks!
Did you already included the user-space part to ebtables?
Bart De Schuymer
AppliedQuoted 19 lines · Pablo Neira Ayuso
Quoted 18 lines · Bart De Schuymer
Op 20/12/2010 15:57, Florian Westphal schreef:
Quoted 17 lines
To avoid adding a new match revision icmp type/code are stored in the sport/dport area.
Signed-off-by Florian Westphal<[email protected]>Reviewed-by Holger Eitzenberger<[email protected]>---
Changes since v1:
- use u16 where appropriate
- use proper () in if condition
- renamed_portsto_pkthdr
- add comment thatsizeof(_pktheader)is also ok in ICMP6 case.include/linux/netfilter_bridge/ebt_ip6.h | 15 ++++++++-- net/bridge/netfilter/ebt_ip6.c | 46 ++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 15 deletions(-)
Quoted 7 lines
Quoted 3 lines
OK for me.
Reviewed-by Bart De Schuymer<[email protected]>Applied, thanks!
Did you already included the user-space part to ebtables?
I've applied the userspace patch, thanks again.
Bart
Signature · 2 lines
Bart De Schuymer www.artinalgorithms.be