diff mbox

[iptables] extensions/libxt_tcp: fix nftables translate flags value, 'none' vs '0x0'

Message ID 145994465193.22717.2137088538000837721.stgit@nfdev2.cica.es
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Arturo Borrero April 6, 2016, 12:10 p.m. UTC
The iptables command:
 -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE

should translate to:
 tcp flags & fin|syn|rst|psh|ack|urg == 0x0

instead of:
 tcp flags & fin|syn|rst|psh|ack|urg == none

Reported-by: Vadim A. Misbakh-Soloviov <netfilter@mva.name>
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 extensions/libxt_tcp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Vadim A. Misbakh-Soloviov April 6, 2016, 1:54 p.m. UTC | #1
Tested-by: Vadim A. Misbakh-Soloviov <netfilter@mva.name>

--
// now it generates valid nftables rule
Pablo Neira Ayuso April 7, 2016, 9:47 a.m. UTC | #2
On Wed, Apr 06, 2016 at 02:10:52PM +0200, Arturo Borrero Gonzalez wrote:
> The iptables command:
>  -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE
> 
> should translate to:
>  tcp flags & fin|syn|rst|psh|ack|urg == 0x0
> 
> instead of:
>  tcp flags & fin|syn|rst|psh|ack|urg == none

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/extensions/libxt_tcp.c b/extensions/libxt_tcp.c
index 6a85ed4..2a14035 100644
--- a/extensions/libxt_tcp.c
+++ b/extensions/libxt_tcp.c
@@ -390,7 +390,7 @@  static void print_tcp_xlate(struct xt_xlate *xl, uint8_t flags)
 	}
 
 	if (!have_flag)
-		xt_xlate_add(xl, "none");
+		xt_xlate_add(xl, "0x0");
 }
 
 static int tcp_xlate(const void *ip, const struct xt_entry_match *match,