Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-07 Thread David Ahern
On 7/6/18 3:50 AM, Xin Long wrote: >>> Try this: >>> >>> diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c >>> index b21833651394..e46cdd310e5f 100644 >>> --- a/net/ipv4/fib_frontend.c >>> +++ b/net/ipv4/fib_frontend.c >>> @@ -300,6 +300,7 @@ __be32 fib_compute_spec_dst(struct sk_buff

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-06 Thread Xin Long
On Thu, Jul 5, 2018 at 10:07 PM, Xin Long wrote: > On Thu, Jul 5, 2018 at 9:18 PM, David Ahern wrote: >> On 7/5/18 1:57 AM, Xin Long wrote: >>> On Thu, Jul 5, 2018 at 2:36 AM, David Ahern wrote: On 7/4/18 11:56 AM, Xin Long wrote: >> your commands are not a proper test. The test sh

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-05 Thread Xin Long
On Thu, Jul 5, 2018 at 4:21 PM, Xin Long wrote: > On Thu, Jul 5, 2018 at 4:39 AM, Ido Schimmel wrote: >> On Thu, Jul 05, 2018 at 01:56:23AM +0800, Xin Long wrote: >>> On Wed, Jul 4, 2018 at 3:23 AM, David Ahern wrote: >>> > your commands are not a proper test. The test should succeed and fail >>

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-05 Thread Xin Long
On Thu, Jul 5, 2018 at 9:18 PM, David Ahern wrote: > On 7/5/18 1:57 AM, Xin Long wrote: >> On Thu, Jul 5, 2018 at 2:36 AM, David Ahern wrote: >>> On 7/4/18 11:56 AM, Xin Long wrote: >>> > your commands are not a proper test. The test should succeed and fail > based on the routing lookup,

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-05 Thread David Ahern
On 7/5/18 1:57 AM, Xin Long wrote: > On Thu, Jul 5, 2018 at 2:36 AM, David Ahern wrote: >> On 7/4/18 11:56 AM, Xin Long wrote: >> your commands are not a proper test. The test should succeed and fail based on the routing lookup, not iptables rules. >>> A proper test can be done easily wi

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-05 Thread Xin Long
On Thu, Jul 5, 2018 at 4:39 AM, Ido Schimmel wrote: > On Thu, Jul 05, 2018 at 01:56:23AM +0800, Xin Long wrote: >> On Wed, Jul 4, 2018 at 3:23 AM, David Ahern wrote: >> > your commands are not a proper test. The test should succeed and fail >> > based on the routing lookup, not iptables rules. >>

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-05 Thread Xin Long
On Thu, Jul 5, 2018 at 2:36 AM, David Ahern wrote: > On 7/4/18 11:56 AM, Xin Long wrote: > >>> your commands are not a proper test. The test should succeed and fail >>> based on the routing lookup, not iptables rules. >> A proper test can be done easily with netns, as vrf can't isolate much. >> I

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-04 Thread Ido Schimmel
On Thu, Jul 05, 2018 at 01:56:23AM +0800, Xin Long wrote: > On Wed, Jul 4, 2018 at 3:23 AM, David Ahern wrote: > > your commands are not a proper test. The test should succeed and fail > > based on the routing lookup, not iptables rules. > A proper test can be done easily with netns, as vrf can't

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-04 Thread David Ahern
On 7/4/18 11:56 AM, Xin Long wrote: >> your commands are not a proper test. The test should succeed and fail >> based on the routing lookup, not iptables rules. > A proper test can be done easily with netns, as vrf can't isolate much. > I don't want to bother forwarding/ directory with netns, so I

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-04 Thread David Ahern
On 7/4/18 11:56 AM, Xin Long wrote: > A proper test can be done easily with netns, as vrf can't isolate much. > I don't want to bother forwarding/ directory with netns, so I will probably > just drop this selftest, and let the feature patch go first. > > What do you think? > I think I would like

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-04 Thread Xin Long
On Wed, Jul 4, 2018 at 3:23 AM, David Ahern wrote: > On 7/3/18 5:36 AM, Xin Long wrote: >> On Mon, Jul 2, 2018 at 11:12 PM, David Ahern wrote: >>> On 7/2/18 12:30 AM, Xin Long wrote: +ping_ipv4() +{ + sysctl_set net.ipv4.icmp_echo_ignore_broadcasts 0 + bc_forwarding_di

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-03 Thread David Ahern
On 7/3/18 5:36 AM, Xin Long wrote: > On Mon, Jul 2, 2018 at 11:12 PM, David Ahern wrote: >> On 7/2/18 12:30 AM, Xin Long wrote: >>> +ping_ipv4() >>> +{ >>> + sysctl_set net.ipv4.icmp_echo_ignore_broadcasts 0 >>> + bc_forwarding_disable >>> + ping_test $h1 198.51.100.255 >>> + >>> +

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-03 Thread Xin Long
On Mon, Jul 2, 2018 at 11:12 PM, David Ahern wrote: > On 7/2/18 12:30 AM, Xin Long wrote: >> +ping_ipv4() >> +{ >> + sysctl_set net.ipv4.icmp_echo_ignore_broadcasts 0 >> + bc_forwarding_disable >> + ping_test $h1 198.51.100.255 >> + >> + iptables -A INPUT -i vrf-r1 -p icmp -j DROP

Re: [PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-02 Thread David Ahern
On 7/2/18 12:30 AM, Xin Long wrote: > +ping_ipv4() > +{ > + sysctl_set net.ipv4.icmp_echo_ignore_broadcasts 0 > + bc_forwarding_disable > + ping_test $h1 198.51.100.255 > + > + iptables -A INPUT -i vrf-r1 -p icmp -j DROP > + bc_forwarding_restore > + bc_forwarding_enable > +

[PATCHv2 net-next 2/2] selftests: add a selftest for directed broadcast forwarding

2018-07-01 Thread Xin Long
As Ido's suggestion, this patch is to add a selftest for directed broadcast forwarding with vrf. Just note that it puts the h2 into the main route space, so that ping_test could get echo_reply. Signed-off-by: Xin Long --- .../selftests/net/forwarding/router_broadcast.sh | 142 +