From bb594473acd532aee6a268a6b27fd529ac71d4b5 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 29 Aug 2018 11:37:40 +0200 Subject: src: tproxy: relax family restrictions evaluation step currently prohibits tproxy ip to 1.2.3.4 in ip family, and tproxy ip6 to dead::1 in ip6. This seems an arbitrary limitation, just accept this. The current restriction would make json output support harder than needed, as the tproxy expression generated from json path would have to special-case the table its currently in, rather than just using the family attribute in the json output. We obviously still reject the family in case it mismatches the table family (e.g., can't use ip address in ip6 table). Signed-off-by: Florian Westphal --- tests/py/ip6/tproxy.t | 6 ++---- tests/py/ip6/tproxy.t.payload | 11 ++--------- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'tests/py/ip6') diff --git a/tests/py/ip6/tproxy.t b/tests/py/ip6/tproxy.t index dcd2bd8f..4e48d81f 100644 --- a/tests/py/ip6/tproxy.t +++ b/tests/py/ip6/tproxy.t @@ -9,8 +9,6 @@ tproxy to :50080;fail meta l4proto 6 tproxy to [2001:db8::1];ok meta l4proto 17 tproxy to [2001:db8::1]:50080;ok meta l4proto 6 tproxy to :50080;ok -meta l4proto 6 tproxy ip6 to [2001:db8::1];fail -meta l4proto 17 tproxy ip6 to [2001:db8::1]:50080;fail +meta l4proto 6 tproxy ip6 to [2001:db8::1];ok;meta l4proto 6 tproxy to [2001:db8::1] +meta l4proto 17 tproxy ip6 to [2001:db8::1]:50080;ok;meta l4proto 17 tproxy to [2001:db8::1]:50080 meta l4proto 6 tproxy ip6 to :50080;fail - - diff --git a/tests/py/ip6/tproxy.t.payload b/tests/py/ip6/tproxy.t.payload index d03beee4..c78c8a1d 100644 --- a/tests/py/ip6/tproxy.t.payload +++ b/tests/py/ip6/tproxy.t.payload @@ -20,14 +20,14 @@ ip6 x y [ immediate reg 1 0x0000a0c3 ] [ tproxy ip6 port reg 1 ] -# meta l4proto 6 tproxy to [2001:db8::1] +# meta l4proto 6 tproxy ip6 to [2001:db8::1] ip6 x y [ meta load l4proto => reg 1 ] [ cmp eq reg 1 0x00000006 ] [ immediate reg 1 0xb80d0120 0x00000000 0x00000000 0x01000000 ] [ tproxy ip6 addr reg 1 ] -# meta l4proto 17 tproxy to [2001:db8::1]:50080 +# meta l4proto 17 tproxy ip6 to [2001:db8::1]:50080 ip6 x y [ meta load l4proto => reg 1 ] [ cmp eq reg 1 0x00000011 ] @@ -35,10 +35,3 @@ ip6 x y [ immediate reg 2 0x0000a0c3 ] [ tproxy ip6 addr reg 1 port reg 2 ] -# meta l4proto 6 tproxy to :50080 -ip6 x y - [ meta load l4proto => reg 1 ] - [ cmp eq reg 1 0x00000006 ] - [ immediate reg 1 0x0000a0c3 ] - [ tproxy ip6 port reg 1 ] - -- cgit v1.2.3