diff options
author | Florian Westphal <fw@strlen.de> | 2018-11-12 12:49:11 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-11-12 14:31:37 +0100 |
commit | 5f508b76a0cebaf91965ffa678089222e2d47964 (patch) | |
tree | 87ce013ac39490afc89811f34308820805d33fac /extensions/libebt_vlan.c | |
parent | 583b27eabcad6588ef6c923551df444c4e30a210 (diff) |
ebtables: use extrapositioned negation consistently
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>
Diffstat (limited to 'extensions/libebt_vlan.c')
-rw-r--r-- | extensions/libebt_vlan.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/extensions/libebt_vlan.c b/extensions/libebt_vlan.c index a2a9dcce..4a2eb712 100644 --- a/extensions/libebt_vlan.c +++ b/extensions/libebt_vlan.c @@ -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)); } } |