diff options
author | Phil Sutter <phil@nwl.cc> | 2021-11-05 17:45:48 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2021-11-23 15:01:23 +0100 |
commit | b5881e7f22d42a8b00acbdbab296b71572ddb903 (patch) | |
tree | a6b2d0229c82398d3960d86a221e462098666060 /iptables/nft-ipv4.c | |
parent | 1189d830ea4fd269da87761d400ebabca02e1ef3 (diff) |
nft: Change whitespace printing in save_rule callback
This aligns whitespace printing with legacy iptables' print_rule4() in
order to prepare for further code-sharing.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft-ipv4.c')
-rw-r--r-- | iptables/nft-ipv4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c index febd7673..287112d0 100644 --- a/iptables/nft-ipv4.c +++ b/iptables/nft-ipv4.c @@ -303,7 +303,7 @@ static void save_ipv4_addr(char letter, const struct in_addr *addr, if (!mask && !invert && !addr->s_addr) return; - printf("%s-%c %s/%s ", invert ? "! " : "", letter, + printf("%s -%c %s/%s", invert ? " !" : "", letter, inet_ntop(AF_INET, addr, addrbuf, sizeof(addrbuf)), mask_to_str(mask)); } @@ -323,8 +323,8 @@ static void nft_ipv4_save_rule(const void *data, unsigned int format) if (cs->fw.ip.flags & IPT_F_FRAG) { if (cs->fw.ip.invflags & IPT_INV_FRAG) - printf("! "); - printf("-f "); + printf(" !"); + printf(" -f"); } save_matches_and_target(cs, cs->fw.ip.flags & IPT_F_GOTO, |