diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-06-03 01:46:06 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-06-07 21:35:27 +0200 |
commit | 1c934617f661dc0bc471c0f0b4ace254c55182df (patch) | |
tree | 9ff04e608ed4565a6514b73c87338a65a4c111c0 /extensions/libxt_tcp.c | |
parent | bb01e33d3828d08cd77cc3c9664b2a995ee150cc (diff) |
extensions: libxt_tcp: rework translation to use flags match representation
Use the new flags match representation available since nftables 0.9.9
to simplify the translation.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'extensions/libxt_tcp.c')
-rw-r--r-- | extensions/libxt_tcp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/libxt_tcp.c b/extensions/libxt_tcp.c index 383e4db5..0b115cdd 100644 --- a/extensions/libxt_tcp.c +++ b/extensions/libxt_tcp.c @@ -381,7 +381,7 @@ static void print_tcp_xlate(struct xt_xlate *xl, uint8_t flags) for (i = 0; (flags & tcp_flag_names_xlate[i].flag) == 0; i++); if (have_flag) - xt_xlate_add(xl, "|"); + xt_xlate_add(xl, ","); xt_xlate_add(xl, "%s", tcp_flag_names_xlate[i].name); have_flag = 1; @@ -435,11 +435,11 @@ static int tcp_xlate(struct xt_xlate *xl, return 0; if (tcpinfo->flg_mask || (tcpinfo->invflags & XT_TCP_INV_FLAGS)) { - xt_xlate_add(xl, "%stcp flags & (", space); - print_tcp_xlate(xl, tcpinfo->flg_mask); - xt_xlate_add(xl, ") %s ", - tcpinfo->invflags & XT_TCP_INV_FLAGS ? "!=": "=="); + xt_xlate_add(xl, "%stcp flags %s", space, + tcpinfo->invflags & XT_TCP_INV_FLAGS ? "!= ": ""); print_tcp_xlate(xl, tcpinfo->flg_cmp); + xt_xlate_add(xl, " / "); + print_tcp_xlate(xl, tcpinfo->flg_mask); } return 1; |