summaryrefslogtreecommitdiffstats
path: root/extensions/libebt_ip6.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-05-08 10:15:11 +0200
committerFlorian Westphal <fw@strlen.de>2018-05-10 02:31:05 +0200
commit6454d7dc89f83920cd08606fdff43358c7e64a53 (patch)
tree33294b8d8675aaa706fb12842af294408360bbdf /extensions/libebt_ip6.c
parent07f4ca96816886635acfb9478b2d04929938eb78 (diff)
ebtables-translate: suppress redundant protocols
kernel would reject ip, ip6 etc. without -p ip, -p ip6. So add it. On reverse, search the match list to decide if -p has to be translated or not. Also, icmp and icmpv6 also imply l3 protocol, so no need to translate that either. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'extensions/libebt_ip6.c')
-rw-r--r--extensions/libebt_ip6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/libebt_ip6.c b/extensions/libebt_ip6.c
index f1ebb8b9..4c60570e 100644
--- a/extensions/libebt_ip6.c
+++ b/extensions/libebt_ip6.c
@@ -564,7 +564,7 @@ static int brip6_xlate(struct xt_xlate *xl,
if (info->bitmask & EBT_IP6_PROTO) {
struct protoent *pe;
- if (info->bitmask & (EBT_IP6_SPORT|EBT_IP6_DPORT) &&
+ if (info->bitmask & (EBT_IP6_SPORT|EBT_IP6_DPORT|EBT_IP6_ICMP6) &&
(info->invflags & EBT_IP6_PROTO) == 0) {
/* port number given and not inverted, no need to
* add explicit 'meta l4proto'.