]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: use extrapositioned negation consistently
authorFlorian Westphal <fw@strlen.de>
Mon, 12 Nov 2018 11:49:11 +0000 (12:49 +0100)
committerFlorian Westphal <fw@strlen.de>
Mon, 12 Nov 2018 13:31:37 +0000 (14:31 +0100)
in the iptables universe, we enforce extrapositioned negation:

! -i foo

"-i ! foo" is not even supported anymore.

At least make sure that ebtables prints the former syntax everywhere as
well so we don't have a mix of both ways.
Parsing of --option ! 42 will still work for backwards compat reasons.

Signed-off-by: Florian Westphal <fw@strlen.de>
17 files changed:
extensions/libebt_802_3.c
extensions/libebt_802_3.t
extensions/libebt_arp.c
extensions/libebt_arp.t
extensions/libebt_ip.c
extensions/libebt_ip.t
extensions/libebt_ip6.c
extensions/libebt_ip6.t
extensions/libebt_mark_m.c
extensions/libebt_mark_m.t
extensions/libebt_pkttype.c
extensions/libebt_pkttype.t
extensions/libebt_standard.t
extensions/libebt_stp.c
extensions/libebt_vlan.c
extensions/libebt_vlan.t
iptables/nft-bridge.c

index f05d02ead5a4a6d8046e8719af28ce11924fdbe3..9e91d0526259100868c37960c69b35c63b89b09d 100644 (file)
@@ -98,15 +98,15 @@ static void br802_3_print(const void *ip, const struct xt_entry_match *match,
        struct ebt_802_3_info *info = (struct ebt_802_3_info *)match->data;
 
        if (info->bitmask & EBT_802_3_SAP) {
-               printf("--802_3-sap ");
                if (info->invflags & EBT_802_3_SAP)
                        printf("! ");
+               printf("--802_3-sap ");
                printf("0x%.2x ", info->sap);
        }
        if (info->bitmask & EBT_802_3_TYPE) {
-               printf("--802_3-type ");
                if (info->invflags & EBT_802_3_TYPE)
                        printf("! ");
+               printf("--802_3-type ");
                printf("0x%.4x ", ntohs(info->type));
        }
 }
index ddfb2f0a72baf46ca9f35c9042059cc6a32b9858..61081bd6983a8db4affaa90141789f35e7a01409 100644 (file)
@@ -1,3 +1,3 @@
 :INPUT,FORWARD,OUTPUT
---802_3-sap ! 0x0a -j CONTINUE;=;OK
+! --802_3-sap 0x0a -j CONTINUE;=;OK
 --802_3-type 0x000a -j RETURN;=;OK
index a062b7e7e586440fce9b995b5f9e84a4ed1598fc..c1b0ab1db0cf151b66806de8b1f7c5c6727a088e 100644 (file)
@@ -338,51 +338,51 @@ static void brarp_print(const void *ip, const struct xt_entry_match *match, int
 
        if (arpinfo->bitmask & EBT_ARP_OPCODE) {
                int opcode = ntohs(arpinfo->opcode);
-               printf("--arp-op ");
                if (arpinfo->invflags & EBT_ARP_OPCODE)
                        printf("! ");
+               printf("--arp-op ");
                if (opcode > 0 && opcode <= ARRAY_SIZE(opcodes))
                        printf("%s ", opcodes[opcode - 1]);
                else
                        printf("%d ", opcode);
        }
        if (arpinfo->bitmask & EBT_ARP_HTYPE) {
-               printf("--arp-htype ");
                if (arpinfo->invflags & EBT_ARP_HTYPE)
                        printf("! ");
+               printf("--arp-htype ");
                printf("%d ", ntohs(arpinfo->htype));
        }
        if (arpinfo->bitmask & EBT_ARP_PTYPE) {
-               printf("--arp-ptype ");
                if (arpinfo->invflags & EBT_ARP_PTYPE)
                        printf("! ");
+               printf("--arp-ptype ");
                printf("0x%x ", ntohs(arpinfo->ptype));
        }
        if (arpinfo->bitmask & EBT_ARP_SRC_IP) {
-               printf("--arp-ip-src ");
                if (arpinfo->invflags & EBT_ARP_SRC_IP)
                        printf("! ");
+               printf("--arp-ip-src ");
                printf("%s%s ", xtables_ipaddr_to_numeric((const struct in_addr*) &arpinfo->saddr),
                       xtables_ipmask_to_numeric((const struct in_addr*)&arpinfo->smsk));
        }
        if (arpinfo->bitmask & EBT_ARP_DST_IP) {
-               printf("--arp-ip-dst ");
                if (arpinfo->invflags & EBT_ARP_DST_IP)
                        printf("! ");
+               printf("--arp-ip-dst ");
                printf("%s%s ", xtables_ipaddr_to_numeric((const struct in_addr*) &arpinfo->daddr),
                       xtables_ipmask_to_numeric((const struct in_addr*)&arpinfo->dmsk));
        }
        if (arpinfo->bitmask & EBT_ARP_SRC_MAC) {
-               printf("--arp-mac-src ");
                if (arpinfo->invflags & EBT_ARP_SRC_MAC)
                        printf("! ");
+               printf("--arp-mac-src ");
                xtables_print_mac_and_mask(arpinfo->smaddr, arpinfo->smmsk);
                printf(" ");
        }
        if (arpinfo->bitmask & EBT_ARP_DST_MAC) {
-               printf("--arp-mac-dst ");
                if (arpinfo->invflags & EBT_ARP_DST_MAC)
                        printf("! ");
+               printf("--arp-mac-dst ");
                xtables_print_mac_and_mask(arpinfo->dmaddr, arpinfo->dmmsk);
                printf(" ");
        }
index 2b064c4bd2066044e1a09c8c03d6f5e27bbd3432..a05ab12dc566f5d006537045f38eb60866ef5c97 100644 (file)
@@ -1,11 +1,12 @@
 :INPUT,FORWARD,OUTPUT
 -p ARP --arp-op Request;=;OK
--p ARP --arp-htype ! 1;=;OK
+-p ARP ! --arp-htype 1;=;OK
 -p ARP --arp-ptype 0x2;=;OK
 -p ARP --arp-ip-src 1.2.3.4;=;OK
--p ARP ! --arp-ip-dst 1.2.3.4;-p ARP --arp-ip-dst ! 1.2.3.4 -j CONTINUE;OK
--p ARP --arp-ip-src ! 0.0.0.0;=;OK
--p ARP --arp-ip-dst ! 0.0.0.0/8;=;OK
+-p ARP ! --arp-ip-dst 1.2.3.4;=;OK
+-p ARP ! --arp-ip-src 0.0.0.0;=;OK
+-p ARP ! --arp-ip-dst 0.0.0.0/8;=;OK
 -p ARP --arp-mac-src 00:de:ad:be:ef:00;=;OK
 -p ARP --arp-mac-dst de:ad:be:ef:00:00/ff:ff:ff:ff:00:00;=;OK
 -p ARP --arp-gratuitous;=;OK
+--arp-htype 1;=;FAIL
index acb9bfcdbbd9fb56e5dd1e527bcb217fd4cf3ffc..d48704fe1c8026fdeb9eda2c6b40fd1deb3c39cd 100644 (file)
@@ -472,35 +472,35 @@ static void brip_print(const void *ip, const struct xt_entry_match *match,
        struct in_addr *addrp, *maskp;
 
        if (info->bitmask & EBT_IP_SOURCE) {
-               printf("--ip-src ");
                if (info->invflags & EBT_IP_SOURCE)
                        printf("! ");
+               printf("--ip-src ");
                addrp = (struct in_addr *)&info->saddr;
                maskp = (struct in_addr *)&info->smsk;
                printf("%s%s ", xtables_ipaddr_to_numeric(addrp),
                       xtables_ipmask_to_numeric(maskp));
        }
        if (info->bitmask & EBT_IP_DEST) {
-               printf("--ip-dst ");
                if (info->invflags & EBT_IP_DEST)
                        printf("! ");
+               printf("--ip-dst ");
                addrp = (struct in_addr *)&info->daddr;
                maskp = (struct in_addr *)&info->dmsk;
                printf("%s%s ", xtables_ipaddr_to_numeric(addrp),
                       xtables_ipmask_to_numeric(maskp));
        }
        if (info->bitmask & EBT_IP_TOS) {
-               printf("--ip-tos ");
                if (info->invflags & EBT_IP_TOS)
                        printf("! ");
+               printf("--ip-tos ");
                printf("0x%02X ", info->tos);
        }
        if (info->bitmask & EBT_IP_PROTO) {
                struct protoent *pe;
 
-               printf("--ip-proto ");
                if (info->invflags & EBT_IP_PROTO)
                        printf("! ");
+               printf("--ip-proto ");
                pe = getprotobynumber(info->protocol);
                if (pe == NULL) {
                        printf("%d ", info->protocol);
@@ -509,28 +509,28 @@ static void brip_print(const void *ip, const struct xt_entry_match *match,
                }
        }
        if (info->bitmask & EBT_IP_SPORT) {
-               printf("--ip-sport ");
                if (info->invflags & EBT_IP_SPORT)
                        printf("! ");
+               printf("--ip-sport ");
                print_port_range(info->sport);
        }
        if (info->bitmask & EBT_IP_DPORT) {
-               printf("--ip-dport ");
                if (info->invflags & EBT_IP_DPORT)
                        printf("! ");
+               printf("--ip-dport ");
                print_port_range(info->dport);
        }
        if (info->bitmask & EBT_IP_ICMP) {
-               printf("--ip-icmp-type ");
                if (info->invflags & EBT_IP_ICMP)
                        printf("! ");
+               printf("--ip-icmp-type ");
                ebt_print_icmp_type(icmp_codes, ARRAY_SIZE(icmp_codes),
                                    info->icmp_type, info->icmp_code);
        }
        if (info->bitmask & EBT_IP_IGMP) {
-               printf("--ip-igmp-type ");
                if (info->invflags & EBT_IP_IGMP)
                        printf("! ");
+               printf("--ip-igmp-type ");
                ebt_print_icmp_type(igmp_types, ARRAY_SIZE(igmp_types),
                                    info->igmp_type, NULL);
        }
index 87602367182a63a483b6f5d8d0ac6fcf433b57ff..01a91a7385fcceec3c781e3fb458a60b63aefa50 100644 (file)
@@ -1,11 +1,13 @@
 :INPUT,FORWARD,OUTPUT
--p ip --ip-src ! 192.168.0.0/24 -j ACCEPT;-p IPv4 --ip-src ! 192.168.0.0/24 -j ACCEPT;OK
+-p ip --ip-src ! 192.168.0.0/24 -j ACCEPT;-p IPv4 ! --ip-src 192.168.0.0/24 -j ACCEPT;OK
 -p IPv4 --ip-dst 10.0.0.1;=;OK
 -p IPv4 --ip-tos 0xFF;=;OK
--p IPv4 --ip-tos ! 0xFF;=;OK
+-p IPv4 ! --ip-tos 0xFF;=;OK
 -p IPv4 --ip-proto tcp --ip-dport 22;=;OK
 -p IPv4 --ip-proto udp --ip-sport 1024:65535;=;OK
 -p IPv4 --ip-proto 253;=;OK
 -p IPv4 --ip-proto icmp --ip-icmp-type echo-request;=;OK
 -p IPv4 --ip-proto icmp --ip-icmp-type 1/1;=;OK
--p ip --ip-protocol icmp --ip-icmp-type ! 1:10;-p IPv4 --ip-proto icmp --ip-icmp-type ! 1:10/0:255 -j CONTINUE;OK
+-p ip --ip-protocol icmp --ip-icmp-type ! 1:10;-p IPv4 --ip-proto icmp ! --ip-icmp-type 1:10/0:255 -j CONTINUE;OK
+--ip-proto icmp --ip-icmp-type 1/1;=;FAIL
+! -p ip --ip-proto icmp --ip-icmp-type 1/1;=;FAIL
index b8a5a5d8c3a923213146c15fee3da1f65e8e0d36..b727764903ffab6bf7bc663be0a2ab53901568c1 100644 (file)
@@ -399,31 +399,31 @@ static void brip6_print(const void *ip, const struct xt_entry_match *match,
        struct ebt_ip6_info *ipinfo = (struct ebt_ip6_info *)match->data;
 
        if (ipinfo->bitmask & EBT_IP6_SOURCE) {
-               printf("--ip6-src ");
                if (ipinfo->invflags & EBT_IP6_SOURCE)
                        printf("! ");
+               printf("--ip6-src ");
                printf("%s", xtables_ip6addr_to_numeric(&ipinfo->saddr));
                printf("%s ", xtables_ip6mask_to_numeric(&ipinfo->smsk));
        }
        if (ipinfo->bitmask & EBT_IP6_DEST) {
-               printf("--ip6-dst ");
                if (ipinfo->invflags & EBT_IP6_DEST)
                        printf("! ");
+               printf("--ip6-dst ");
                printf("%s", xtables_ip6addr_to_numeric(&ipinfo->daddr));
                printf("%s ", xtables_ip6mask_to_numeric(&ipinfo->dmsk));
        }
        if (ipinfo->bitmask & EBT_IP6_TCLASS) {
-               printf("--ip6-tclass ");
                if (ipinfo->invflags & EBT_IP6_TCLASS)
                        printf("! ");
+               printf("--ip6-tclass ");
                printf("0x%02X ", ipinfo->tclass);
        }
        if (ipinfo->bitmask & EBT_IP6_PROTO) {
                struct protoent *pe;
 
-               printf("--ip6-proto ");
                if (ipinfo->invflags & EBT_IP6_PROTO)
                        printf("! ");
+               printf("--ip6-proto ");
                pe = getprotobynumber(ipinfo->protocol);
                if (pe == NULL) {
                        printf("%d ", ipinfo->protocol);
@@ -432,21 +432,21 @@ static void brip6_print(const void *ip, const struct xt_entry_match *match,
                }
        }
        if (ipinfo->bitmask & EBT_IP6_SPORT) {
-               printf("--ip6-sport ");
                if (ipinfo->invflags & EBT_IP6_SPORT)
                        printf("! ");
+               printf("--ip6-sport ");
                print_port_range(ipinfo->sport);
        }
        if (ipinfo->bitmask & EBT_IP6_DPORT) {
-               printf("--ip6-dport ");
                if (ipinfo->invflags & EBT_IP6_DPORT)
                        printf("! ");
+               printf("--ip6-dport ");
                print_port_range(ipinfo->dport);
        }
        if (ipinfo->bitmask & EBT_IP6_ICMP6) {
-               printf("--ip6-icmp-type ");
                if (ipinfo->invflags & EBT_IP6_ICMP6)
                        printf("! ");
+               printf("--ip6-icmp-type ");
                print_icmp_type(ipinfo->icmpv6_type, ipinfo->icmpv6_code);
        }
 }
index 9d4effdc20e5a2c902bd0a6f29bbc3909090dec4..6b3221ea58f620a22a4735b0b9754609970ad948 100644 (file)
@@ -1,13 +1,15 @@
 :INPUT,FORWARD,OUTPUT
--p ip6 --ip6-src ! dead::beef/64 -j ACCEPT;-p IPv6 --ip6-src ! dead::/64 -j ACCEPT;OK
+-p ip6 ! --ip6-src dead::beef/64 -j ACCEPT;-p IPv6 ! --ip6-src dead::/64 -j ACCEPT;OK
 -p IPv6 --ip6-dst dead:beef::/64 -j ACCEPT;=;OK
 -p IPv6 --ip6-dst f00:ba::;=;OK
 -p IPv6 --ip6-tclass 0xFF;=;OK
 -p IPv6 --ip6-proto tcp --ip6-dport 22;=;OK
--p IPv6 --ip6-proto tcp --ip6-dport ! 22;=;OK
+-p IPv6 --ip6-proto tcp ! --ip6-dport 22;=;OK
 -p IPv6 --ip6-proto udp --ip6-sport 1024:65535;=;OK
 -p IPv6 --ip6-proto 253;=;OK
 -p IPv6 --ip6-proto ipv6-icmp --ip6-icmp-type echo-request -j CONTINUE;=;OK
 -p IPv6 --ip6-proto ipv6-icmp --ip6-icmp-type echo-request;=;OK
 -p ip6 --ip6-protocol icmpv6 --ip6-icmp-type 1/1;-p IPv6 --ip6-proto ipv6-icmp --ip6-icmp-type communication-prohibited -j CONTINUE;OK
--p IPv6 --ip6-proto ipv6-icmp --ip6-icmp-type ! 1:10/0:255;=;OK
+-p IPv6 --ip6-proto ipv6-icmp ! --ip6-icmp-type 1:10/0:255;=;OK
+--ip6-proto ipv6-icmp ! --ip6-icmp-type 1:10/0:255;=;FAIL
+! -p IPv6 --ip6-proto ipv6-icmp ! --ip6-icmp-type 1:10/0:255;=;FAIL
index 244fe12a58bb21f00aa98b7ccc7024fd6540977c..7bde77d95ffaf4bfbc61b2c8cf3d164b90d5a41a 100644 (file)
@@ -86,9 +86,9 @@ static void brmark_m_print(const void *ip, const struct xt_entry_match *match,
 {
        struct ebt_mark_m_info *info = (struct ebt_mark_m_info *)match->data;
 
-       printf("--mark ");
        if (info->invert)
                printf("! ");
+       printf("--mark ");
        if (info->bitmask == EBT_MARK_OR)
                printf("/0x%lx ", info->mask);
        else if (info->mask != 0xffffffff)
index 00035427f8b6ed8f941fc9d5f9f08dae5fc20c1c..9ad41704fbb82e38efda00b6283fa8020ce1581e 100644 (file)
@@ -1,6 +1,6 @@
 :INPUT,FORWARD,OUTPUT
 --mark 42;--mark 0x2a;OK
---mark ! 42;--mark ! 0x2a;OK
+--mark ! 42;! --mark 0x2a;OK
 --mark 42/0xff;--mark 0x2a/0xff;OK
---mark ! 0x1/0xff;=;OK
+! --mark 0x1/0xff;=;OK
 --mark /0x2;=;OK
index 4e2d19de7983b3bfb43d074dd80f5933ea166dcc..265674d19bde67cc3168be3e160e9d6b57121401 100644 (file)
@@ -75,7 +75,10 @@ static void brpkttype_print(const void *ip, const struct xt_entry_match *match,
 {
        struct ebt_pkttype_info *pt = (struct ebt_pkttype_info *)match->data;
 
-       printf("--pkttype-type %s", pt->invert ? "! " : "");
+       if (pt->invert)
+               printf("! ");
+
+       printf("--pkttype-type ");
 
        if (pt->pkt_type < ARRAY_SIZE(classes))
                printf("%s ", classes[pt->pkt_type]);
index f5f76aaaebfdc54f4acd1f757366d2a61633163e..f870f5c7f05c418e3341c6f967d0dfbb01388752 100644 (file)
@@ -1,9 +1,13 @@
 :INPUT,FORWARD,OUTPUT
-! --pkttype-type host;--pkttype-type ! host -j CONTINUE;OK
 --pkttype-type host;=;OK
+! --pkttype-type host;=;OK
 --pkttype-type broadcast;=;OK
---pkttype-type ! multicast;=;OK
+! --pkttype-type broadcast;=;OK
 --pkttype-type multicast;=;OK
+! --pkttype-type multicast;=;OK
 --pkttype-type otherhost;=;OK
+! --pkttype-type otherhost;=;OK
 --pkttype-type outgoing;=;OK
+! --pkttype-type outgoing;=;OK
 --pkttype-type loopback;=;OK
+! --pkttype-type loopback;=;OK
index c0b87e128d5186081e38aa8a5ce8cf111fb5486c..72081fd6575a07274c9187170f9b3b98ffdb9d76 100644 (file)
@@ -5,3 +5,7 @@
 -s de:ad:be:ef:0:00 -j RETURN;-s de:ad:be:ef:00:00 -j RETURN;OK
 -d de:ad:be:ef:00:00 -j CONTINUE;=;OK
 -d de:ad:be:ef:0:00/ff:ff:ff:ff:0:0 -j DROP;-d de:ad:be:ef:00:00/ff:ff:ff:ff:00:00 -j DROP;OK
+-p ARP -j ACCEPT;=;OK
+! -p ARP -j ACCEPT;=;OK
+-p 0 -j ACCEPT;=;FAIL
+! -p 0 -j ACCEPT;=;FAIL
index 06cf93b8d84498de77fc3549145e0f9d2fce3bb3..33e4c8d9c615dcf6cf1cbd92f0ffc4b5b9809bd1 100644 (file)
@@ -307,8 +307,9 @@ static void brstp_print(const void *ip, const struct xt_entry_match *match,
        for (i = 0; i < STP_NUMOPS; i++) {
                if (!(stpinfo->bitmask & (1 << i)))
                        continue;
-               printf("--%s %s", brstp_opts[i].name,
-                      (stpinfo->invflags & (1 << i)) ? "! " : "");
+               if (stpinfo->invflags & (1 << i))
+                       printf("! ");
+               printf("--%s ", brstp_opts[i].name);
                if (EBT_STP_TYPE == (1 << i)) {
                        if (stpinfo->type == BPDU_TYPE_CONFIG)
                                printf("%s", BPDU_TYPE_CONFIG_STRING);
index a2a9dcce531ce51a3c6d103fced153ba877b80b5..4a2eb7126895eb63e12fe22e268f6b9eb1a8a20e 100644 (file)
@@ -108,14 +108,19 @@ static void brvlan_print(const void *ip, const struct xt_entry_match *match,
        struct ebt_vlan_info *vlaninfo = (struct ebt_vlan_info *) match->data;
 
        if (vlaninfo->bitmask & EBT_VLAN_ID) {
-               printf("--vlan-id %s%d ", (vlaninfo->invflags & EBT_VLAN_ID) ? "! " : "", vlaninfo->id);
+               if (vlaninfo->invflags & EBT_VLAN_ID)
+                       printf("! ");
+               printf("--vlan-id %d ", vlaninfo->id);
        }
        if (vlaninfo->bitmask & EBT_VLAN_PRIO) {
-               printf("--vlan-prio %s%d ", (vlaninfo->invflags & EBT_VLAN_PRIO) ? "! " : "", vlaninfo->prio);
+               if (vlaninfo->invflags & EBT_VLAN_PRIO)
+                       printf("! ");
+               printf("--vlan-prio %d ", vlaninfo->prio);
        }
        if (vlaninfo->bitmask & EBT_VLAN_ENCAP) {
-               printf("--vlan-encap %s", (vlaninfo->invflags & EBT_VLAN_ENCAP) ? "! " : "");
-               printf("%4.4X ", ntohs(vlaninfo->encap));
+               if (vlaninfo->invflags & EBT_VLAN_ENCAP)
+                       printf("! ");
+               printf("--vlan-encap %4.4X ", ntohs(vlaninfo->encap));
        }
 }
 
index 58471caa2343d3cef43e3d60e4ab3650e3c84f8d..106374cd9cb80ba988fb6c8f601176666819aa61 100644 (file)
@@ -1,5 +1,13 @@
 :INPUT,FORWARD,OUTPUT
 -p 802_1Q --vlan-id 42;=;OK
--p 802_1Q --vlan-prio ! 1;=;OK
+-p 802_1Q ! --vlan-id 42;=;OK
+-p 802_1Q --vlan-prio 1;=;OK
+-p 802_1Q ! --vlan-prio 1;=;OK
 -p 802_1Q --vlan-encap ip;-p 802_1Q --vlan-encap 0800 -j CONTINUE;OK
--p 802_1Q --vlan-encap IPv6 ! --vlan-id 1;-p 802_1Q --vlan-id ! 1 --vlan-encap 86DD -j CONTINUE;OK
+-p 802_1Q --vlan-encap 0800 ;=;OK
+-p 802_1Q ! --vlan-encap 0800 ;=;OK
+-p 802_1Q --vlan-encap IPv6 ! --vlan-id 1;-p 802_1Q ! --vlan-id 1 --vlan-encap 86DD -j CONTINUE;OK
+-p 802_1Q ! --vlan-id 1 --vlan-encap 86DD;=;OK
+--vlan-encap ip;=;FAIL
+--vlan-id 2;=;FAIL
+--vlan-prio 1;=;FAIL
index 8c69a23616fbd674e3cb922a9ae71c71a4b60338..ad583a60c424d07e8a67102a5f533afe7cb61616 100644 (file)
@@ -379,9 +379,9 @@ static void print_mac(char option, const unsigned char *mac,
                      const unsigned char *mask,
                      bool invert)
 {
-       printf("-%c ", option);
        if (invert)
                printf("! ");
+       printf("-%c ", option);
        ebt_print_mac_and_mask(mac, mask);
        printf(" ");
 }
@@ -396,9 +396,9 @@ static void print_protocol(uint16_t ethproto, bool invert, unsigned int bitmask)
        if (bitmask & EBT_NOPROTO)
                return;
 
-       printf("-p ");
        if (invert)
                printf("! ");
+       printf("-p ");
 
        if (bitmask & EBT_802_3) {
                printf("length ");