diff options
author | Phil Sutter <phil@nwl.cc> | 2022-11-25 04:27:21 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2022-11-29 13:25:26 +0100 |
commit | 7533e96dadfcecbb49f819976ffc986a67920545 (patch) | |
tree | d958a2655969aaf9f52a08c58ac2ac6207ea44f3 /extensions/libip6t_frag.c | |
parent | 023dd2c515be63ddb2f0b6a6f3bccab4cdf7a71c (diff) |
extensions: Leverage xlate auto-spacing
Drop code which is used explicitly to deal with spacing.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libip6t_frag.c')
-rw-r--r-- | extensions/libip6t_frag.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/extensions/libip6t_frag.c b/extensions/libip6t_frag.c index 72a43153..49c787e7 100644 --- a/extensions/libip6t_frag.c +++ b/extensions/libip6t_frag.c @@ -178,7 +178,6 @@ static int frag_xlate(struct xt_xlate *xl, { const struct ip6t_frag *fraginfo = (struct ip6t_frag *)params->match->data; - char *space= ""; if (!(fraginfo->ids[0] == 0 && fraginfo->ids[1] == 0xFFFFFFFF)) { xt_xlate_add(xl, "frag id %s", @@ -190,26 +189,21 @@ static int frag_xlate(struct xt_xlate *xl, else xt_xlate_add(xl, "%u", fraginfo->ids[0]); - space = " "; } /* ignore ineffective IP6T_FRAG_LEN bit */ - if (fraginfo->flags & IP6T_FRAG_RES) { - xt_xlate_add(xl, "%sfrag reserved 1", space); - space = " "; - } - if (fraginfo->flags & IP6T_FRAG_FST) { - xt_xlate_add(xl, "%sfrag frag-off 0", space); - space = " "; - } - if (fraginfo->flags & IP6T_FRAG_MF) { - xt_xlate_add(xl, "%sfrag more-fragments 1", space); - space = " "; - } - if (fraginfo->flags & IP6T_FRAG_NMF) { - xt_xlate_add(xl, "%sfrag more-fragments 0", space); - } + if (fraginfo->flags & IP6T_FRAG_RES) + xt_xlate_add(xl, "frag reserved 1"); + + if (fraginfo->flags & IP6T_FRAG_FST) + xt_xlate_add(xl, "frag frag-off 0"); + + if (fraginfo->flags & IP6T_FRAG_MF) + xt_xlate_add(xl, "frag more-fragments 1"); + + if (fraginfo->flags & IP6T_FRAG_NMF) + xt_xlate_add(xl, "frag more-fragments 0"); return 1; } |