Skip to content

Commit eaf6f15

Browse files
tzarchauke
authored andcommitted
nftables: Update to 0.7
Updated nftables to latest. Signed-off-by: Nick Brassel <[email protected]>
1 parent cd54b2d commit eaf6f15

File tree

2 files changed

+79
-3
lines changed

2 files changed

+79
-3
lines changed

package/network/utils/nftables/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
include $(TOPDIR)/rules.mk
88

99
PKG_NAME:=nftables
10-
PKG_VERSION:=0.4+2015-04-09
10+
PKG_VERSION:=0.7+2016-12-20
1111
PKG_RELEASE:=1
1212

1313
PKG_SOURCE_URL:=git://git.netfilter.org/nftables
1414
PKG_SOURCE_PROTO:=git
15-
PKG_SOURCE_VERSION:=3ed296118a065caff5600e60d4f7ef18e137f9a0
16-
PKG_MIRROR_HASH:=7f6f6162592c848b8047e75374f01a93d2d269dabe013a0150767027049b1e41
15+
PKG_SOURCE_VERSION:=79cbd19e7437680561b26109bbf4f48cb2e8e0a7
16+
PKG_MIRROR_HASH:=6b06a114c5a1b397b0ae616d5d292859611b0eb05b647182b3c00421909338b8
1717
PKG_MAINTAINER:=Steven Barth <[email protected]>
1818
PKG_LICENSE:=GPL-2.0
1919

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
From patchwork Fri Feb 3 14:25:45 2017
2+
Content-Type: text/plain; charset="utf-8"
3+
MIME-Version: 1.0
4+
Content-Transfer-Encoding: 7bit
5+
Subject: [nftables] statement: fix print of ip dnat address
6+
From: Florian Westphal <[email protected]>
7+
X-Patchwork-Id: 723692
8+
X-Patchwork-Delegate: [email protected]
9+
Message-Id: <[email protected]>
10+
11+
Cc: Florian Westphal <[email protected]>
12+
Date: Fri, 3 Feb 2017 15:25:45 +0100
13+
14+
the change causes non-ipv6 addresses to not be printed at all in case
15+
a nfproto was given.
16+
17+
Also add a test case to catch this.
18+
19+
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1117
20+
Fixes: 5ab0e10fc6e2c22363a ("src: support for RFC2732 IPv6 address format with brackets")
21+
Signed-off-by: Florian Westphal <[email protected]>
22+
Acked-by: Pablo Neira Ayuso <[email protected]>
23+
---
24+
src/statement.c | 2 ++
25+
tests/py/ip/dnat.t | 1 +
26+
tests/py/ip/dnat.t.payload.ip | 12 ++++++++++++
27+
3 files changed, 15 insertions(+)
28+
29+
diff --git a/src/statement.c b/src/statement.c
30+
index 9cdabbb979e8..3beb86ab4263 100644
31+
--- a/src/statement.c
32+
+++ b/src/statement.c
33+
@@ -508,6 +508,8 @@ static void nat_stmt_print(const struct stmt *stmt)
34+
printf("]-[");
35+
expr_print(stmt->nat.addr->right);
36+
printf("]");
37+
+ } else {
38+
+ expr_print(stmt->nat.addr);
39+
}
40+
} else {
41+
expr_print(stmt->nat.addr);
42+
diff --git a/tests/py/ip/dnat.t b/tests/py/ip/dnat.t
43+
index da00106edbb4..089017c84704 100644
44+
--- a/tests/py/ip/dnat.t
45+
+++ b/tests/py/ip/dnat.t
46+
@@ -7,6 +7,7 @@ iifname "eth0" tcp dport != 80-90 dnat to 192.168.3.2;ok
47+
iifname "eth0" tcp dport {80, 90, 23} dnat to 192.168.3.2;ok
48+
iifname "eth0" tcp dport != {80, 90, 23} dnat to 192.168.3.2;ok
49+
iifname "eth0" tcp dport != 23-34 dnat to 192.168.3.2;ok
50+
+iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080;ok
51+
52+
dnat to ct mark map { 0x00000014 : 1.2.3.4};ok
53+
dnat to ct mark . ip daddr map { 0x00000014 . 1.1.1.1 : 1.2.3.4};ok
54+
diff --git a/tests/py/ip/dnat.t.payload.ip b/tests/py/ip/dnat.t.payload.ip
55+
index 66926990d880..7a7f5a82dd5a 100644
56+
--- a/tests/py/ip/dnat.t.payload.ip
57+
+++ b/tests/py/ip/dnat.t.payload.ip
58+
@@ -60,6 +60,18 @@ ip test-ip4 prerouting
59+
[ immediate reg 1 0x0203a8c0 ]
60+
[ nat dnat ip addr_min reg 1 addr_max reg 0 ]
61+
62+
+# iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080
63+
+ip test-ip4 prerouting
64+
+ [ meta load iifname => reg 1 ]
65+
+ [ cmp eq reg 1 0x30687465 0x00000000 0x00000000 0x00000000 ]
66+
+ [ payload load 1b @ network header + 9 => reg 1 ]
67+
+ [ cmp eq reg 1 0x00000006 ]
68+
+ [ payload load 2b @ transport header + 2 => reg 1 ]
69+
+ [ cmp eq reg 1 0x00005100 ]
70+
+ [ immediate reg 1 0x0203a8c0 ]
71+
+ [ immediate reg 2 0x0000901f ]
72+
+ [ nat dnat ip addr_min reg 1 addr_max reg 0 proto_min reg 2 proto_max reg 0 ]
73+
+
74+
# dnat to ct mark map { 0x00000014 : 1.2.3.4}
75+
__map%d test-ip4 b
76+
__map%d test-ip4 0

0 commit comments

Comments
 (0)