]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: xtoptions: Treat NFPROTO_BRIDGE as IPv4
authorPhil Sutter <phil@nwl.cc>
Wed, 13 Dec 2023 20:14:58 +0000 (21:14 +0100)
committerPhil Sutter <phil@nwl.cc>
Wed, 10 Jan 2024 15:07:31 +0000 (16:07 +0100)
When parsing for XTTYPE_HOST(MASK), the return value of afinfo_family()
is used to indicate the expected address family.

Make guided option parser expect IPv4 by default for ebtables as this is
the more common case. The exception is libebt_ip6, which will
temporarily adjust afinfo->family while parsing.

libxtables/xtoptions.c

index 7a0e44b34ac9bf4f5d1d98f8cd45c5c96a778836..f622f4c6ea3280bda42d09672cf99553da4d6008 100644 (file)
@@ -71,6 +71,7 @@ static uint8_t afinfo_family(void)
 {
        switch (afinfo->family) {
        case NFPROTO_ARP:
+       case NFPROTO_BRIDGE:
                return NFPROTO_IPV4;
        default:
                return afinfo->family;