From 6454d7dc89f83920cd08606fdff43358c7e64a53 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 8 May 2018 10:15:11 +0200 Subject: 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 --- extensions/libebt_ip6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extensions/libebt_ip6.c') 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'. -- cgit v1.2.3