Re: [PATCH net 0/2] net: do not modify the shared tunnel info when PMTU triggers an ICMP reply

2021-03-25 Thread Stefano Brivio
t modify the shared tunnel info when PMTU triggers an ICMP > reply > geneve: do not modify the shared tunnel info when PMTU triggers an > ICMP reply For the series, Reviewed-by: Stefano Brivio Thanks for fixing this! -- Stefano

[PATCH net] tunnels: Fix off-by-one in lower MTU bounds for ICMP/ICMPv6 replies

2020-11-06 Thread Stefano Brivio
o the different tunneling overheads implied by the corresponding configurations. Reported-by: Jianlin Shi Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets") Signed-off-by: Stefano Brivio --- net/ipv4/ip_tunnel_core.c | 4 ++-- 1 file changed, 2 insertions

Re: [PATCH net-next v3 1/3] net: openvswitch: improve coding style

2020-08-25 Thread Stefano Brivio
On Tue, 25 Aug 2020 13:06:34 +0800 xiangxia.m@gmail.com wrote: > +++ b/net/openvswitch/datapath.c > > [...] > > @@ -2095,7 +2099,7 @@ static void ovs_update_headroom(struct datapath *dp, > unsigned int new_headroom) > dp->max_headroom = new_headroom; > for (i = 0; i < DP_VPORT_HAS

Re: [PATCH 2/2 nf] selftests: netfilter: exit on invalid parameters

2020-08-17 Thread Stefano Brivio
Hi Fabian, On Fri, 14 Aug 2020 20:55:44 +0200 Fabian Frederick wrote: > exit script with comments when parameters are wrong during address > addition. No need for a message when trying to change MTU with lower > values: output is self-explanatory > > Signed-off-by: Fabian Frederick > --- > to

Re: linux-next: build failure after merge of the net-next tree

2020-08-05 Thread Stefano Brivio
On Wed, 5 Aug 2020 15:21:44 +0200 Heiko Carstens wrote: > On Wed, Aug 05, 2020 at 03:06:27PM +0200, Stefano Brivio wrote: > > On Wed, 5 Aug 2020 22:31:21 +1000 > > Stephen Rothwell wrote: > > > > > Hi all, > > > > > > After merging the net-nex

Re: [PATCH net-next v2 2/6] tunnels: PMTU discovery support for directly bridged IP packets

2020-08-05 Thread Stefano Brivio
Hi Naresh, On Wed, 5 Aug 2020 22:24:03 +0530 Naresh Kamboju wrote: > On Tue, 4 Aug 2020 at 11:24, Stefano Brivio wrote: > > > > + icmp6h->icmp6_cksum = csum_ipv6_magic(&nip6h->saddr, &nip6h->daddr, > > len, > > +

[PATCH RESEND net-next] ip_tunnel_core: Fix build for archs without _HAVE_ARCH_IPV6_CSUM

2020-08-05 Thread Stefano Brivio
: Stephen Rothwell Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets") Signed-off-by: Stefano Brivio --- I'm submitting this for net-next despite the fact it's closed, as the offending code isn't merged to net.git yet. Should I rather sub

Re: linux-next: build failure after merge of the net-next tree

2020-08-05 Thread Stefano Brivio
On Wed, 5 Aug 2020 22:31:21 +1000 Stephen Rothwell wrote: > Hi all, > > After merging the net-next tree, today's linux-next build (s390 defconfig) > failed like this: > > net/ipv4/ip_tunnel_core.c:335:2: error: implicit declaration of function > 'csum_ipv6_magic' [-Werror=implicit-function-dec

[PATCH net-next] ip_tunnel_core: Fix build for archs without _HAVE_ARCH_IPV6_CSUM

2020-08-05 Thread Stefano Brivio
: Stephen Rothwell Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets") Signed-off-by: Stefano Brivio --- I'm submitting this for net-next despite the fact it's closed, as the offending code isn't merged to net.git yet. Should I rather sub

Re: [PATCH net-next v2 5/6] selftests: pmtu.sh: Add tests for bridged UDP tunnels

2020-08-04 Thread Stefano Brivio
On Tue, 4 Aug 2020 08:00:19 -0600 David Ahern wrote: > On 8/3/20 11:53 PM, Stefano Brivio wrote: > > @@ -497,12 +529,19 @@ setup_vxlan_or_geneve() { > > run_cmd ${ns_a} ip link add ${type}_a type ${type} id 1 ${opts_a} > > remote ${b_addr} ${opts} || return 1 > >

[PATCH net-next v2 2/6] tunnels: PMTU discovery support for directly bridged IP packets

2020-08-03 Thread Stefano Brivio
nnel_core.c (David Ahern) - split IPv4/IPv6 functions (David Ahern) Signed-off-by: Stefano Brivio --- drivers/net/bareudp.c | 5 +- drivers/net/geneve.c | 5 +- drivers/net/vxlan.c | 4 +- include/net/dst.h | 10 -- include/net/ip_tunnels.h | 2 + net/ipv4/ip_tunnel_

Re: [PATCH net-next 1/6] ipv4: route: Ignore output interface in FIB lookup for PMTU route

2020-08-03 Thread Stefano Brivio
On Mon, 3 Aug 2020 17:30:46 -0600 David Ahern wrote: > On 8/3/20 2:52 PM, Stefano Brivio wrote: > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > > index a01efa062f6b..c14fd8124f57 100644 > > --- a/net/ipv4/route.c > > +++ b/net/ipv4/route.c > >

[PATCH net-next v2 3/6] vxlan: Support for PMTU discovery on directly bridged links

2020-08-03 Thread Stefano Brivio
s, so that Open vSwitch is able to match this packet against the existing, reverse flow. v2: Use netif_is_any_bridge_port() (David Ahern) Signed-off-by: Stefano Brivio --- drivers/net/vxlan.c | 47 +++-- 1 file changed, 41 insertions(+), 6 deletions(-)

[PATCH net-next v2 0/6] Support PMTU discovery with bridged UDP tunnels

2020-08-03 Thread Stefano Brivio
N and GENEVE, with both regular bridges and Open vSwitch instances. v2: Add helper to check for any bridge port, skip oif check for PMTU routes for bridge ports only, split IPv4 and IPv6 helpers and functions (all suggested by David Ahern) Stefano Brivio (6): ipv4: route: Ignore o

[PATCH net-next v2 4/6] geneve: Support for PMTU discovery on directly bridged links

2020-08-03 Thread Stefano Brivio
r the flow as if we were receiving the packet, so that Open vSwitch can match the ICMP error against the existing association. v2: Use netif_is_any_bridge_port() (David Ahern) Signed-off-by: Stefano Brivio --- drivers/net/geneve.c | 56 1 file change

Re: [PATCH net-next 3/6] vxlan: Support for PMTU discovery on directly bridged links

2020-08-03 Thread Stefano Brivio
On Mon, 3 Aug 2020 17:48:48 -0600 David Ahern wrote: > On 8/3/20 2:52 PM, Stefano Brivio wrote: > > + err = skb_tunnel_check_pmtu(skb, ndst, VXLAN_HEADROOM, > > + netif_is_

[PATCH net-next v2 6/6] selftests: pmtu.sh: Add tests for UDP tunnels handled by Open vSwitch

2020-08-03 Thread Stefano Brivio
possible as a result of PMTU discovery. Signed-off-by: Stefano Brivio --- v2: No changes tools/testing/selftests/net/pmtu.sh | 180 1 file changed, 180 insertions(+) diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh index

[PATCH net-next v2 5/6] selftests: pmtu.sh: Add tests for bridged UDP tunnels

2020-08-03 Thread Stefano Brivio
possible as a result of PMTU discovery. Part of the existing setup functions aren't generic enough to simply add a namespace and a bridge to the existing routing setup. This rework is in progress and we can easily shrink this once more generic topology functions are available. Signed-off-by: St

[PATCH net-next v2 1/6] ipv4: route: Ignore output interface in FIB lookup for PMTU route

2020-08-03 Thread Stefano Brivio
t() helper (David Ahern) Suggested-by: David Ahern Signed-off-by: Stefano Brivio --- include/linux/netdevice.h | 5 + net/ipv4/route.c | 5 + 2 files changed, 10 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 88d40b9abaa1..90444622b703 10

Re: [PATCH net-next 2/6] tunnels: PMTU discovery support for directly bridged IP packets

2020-08-03 Thread Stefano Brivio
On Mon, 3 Aug 2020 17:44:16 -0600 David Ahern wrote: > On 8/3/20 2:52 PM, Stefano Brivio wrote: > > @@ -461,6 +464,91 @@ static inline void iptunnel_xmit_stats(struct > > net_device *dev, int pkt_len) > > [...] > > > > +static inline int skb_tunn

[PATCH net-next 6/6] selftests: pmtu.sh: Add tests for UDP tunnels handled by Open vSwitch

2020-08-03 Thread Stefano Brivio
possible as a result of PMTU discovery. Signed-off-by: Stefano Brivio --- tools/testing/selftests/net/pmtu.sh | 180 1 file changed, 180 insertions(+) diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh index ee79c26a37dd..5401f6fd615d

[PATCH net-next 2/6] tunnels: PMTU discovery support for directly bridged IP packets

2020-08-03 Thread Stefano Brivio
lation headroom, we would advertise MTU as 3950, and we would reject fragmented IPv6 datagrams of 3958 bytes size on the wire. We're exclusively dealing with network MTU here, though, so we could get Ethernet frames up to 3964 octets in that case. Based on earlier patch from Florian Westphal

[PATCH net-next 1/6] ipv4: route: Ignore output interface in FIB lookup for PMTU route

2020-08-03 Thread Stefano Brivio
cket. The behaviour is now consistent with IPv6 and verified with selftests pmtu_ipv{4,6}_br_{geneve,vxlan}{4,6}_exception introduced later in this series. Suggested-by: David Ahern Signed-off-by: Stefano Brivio --- net/ipv4/route.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/rou

[PATCH net-next 4/6] geneve: Support for PMTU discovery on directly bridged links

2020-08-03 Thread Stefano Brivio
r the flow as if we were receiving the packet, so that Open vSwitch can match the ICMP error against the existing association. Signed-off-by: Stefano Brivio --- drivers/net/geneve.c | 58 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/dr

[PATCH net-next 5/6] selftests: pmtu.sh: Add tests for bridged UDP tunnels

2020-08-03 Thread Stefano Brivio
possible as a result of PMTU discovery. Part of the existing setup functions aren't generic enough to simply add a namespace and a bridge to the existing routing setup. This rework is in progress and we can easily shrink this once more generic topology functions are available. Signed-off-by: St

[PATCH net-next 0/6] Support PMTU discovery with bridged UDP tunnels

2020-08-03 Thread Stefano Brivio
N and GENEVE, with both regular bridges and Open vSwitch instances. Stefano Brivio (6): ipv4: route: Ignore output interface in FIB lookup for PMTU route tunnels: PMTU discovery support for directly bridged IP packets vxlan: Support for PMTU discovery on directly bridged links geneve: Su

[PATCH net-next 3/6] vxlan: Support for PMTU discovery on directly bridged links

2020-08-03 Thread Stefano Brivio
s, so that Open vSwitch is able to match this packet against the existing, reverse flow. Signed-off-by: Stefano Brivio --- drivers/net/vxlan.c | 49 +++-- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vx

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-26 Thread Stefano Brivio
On Sun, 19 Jul 2020 21:19:44 -0600 David Ahern wrote: > On 7/19/20 3:49 PM, Stefano Brivio wrote: > >> > >> With this test case, the lookup fails: > >> > >> [ 144.689378] vxlan: vxlan_xmit_one: dev vxlan_a 10.0.1.1/57864 -> > >> 10.0.0.0/

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-19 Thread Stefano Brivio
On Sun, 19 Jul 2020 12:43:55 -0600 David Ahern wrote: > On 7/18/20 11:58 AM, Stefano Brivio wrote: > > On Sat, 18 Jul 2020 11:02:46 -0600 > > David Ahern wrote: > > > >> On 7/18/20 12:56 AM, Stefano Brivio wrote: > >>> On Fri, 17 Jul 20

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-18 Thread Stefano Brivio
On Sat, 18 Jul 2020 19:58:50 +0200 Stefano Brivio wrote: > On Sat, 18 Jul 2020 11:02:46 -0600 > David Ahern wrote: > > > On 7/18/20 12:56 AM, Stefano Brivio wrote: > > > On Fri, 17 Jul 2020 09:04:51 -0600 > > > David Ahern wrote: > > > >

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-18 Thread Stefano Brivio
On Sat, 18 Jul 2020 11:02:46 -0600 David Ahern wrote: > On 7/18/20 12:56 AM, Stefano Brivio wrote: > > On Fri, 17 Jul 2020 09:04:51 -0600 > > David Ahern wrote: > > > >> On 7/17/20 6:27 AM, Stefano Brivio wrote: > >>>> > >>>>&

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-17 Thread Stefano Brivio
On Fri, 17 Jul 2020 09:04:51 -0600 David Ahern wrote: > On 7/17/20 6:27 AM, Stefano Brivio wrote: > >> > >>> Note that this doesn't work as it is because of a number of reasons > >>> (skb doesn't have a dst, pkt_type is not PACKET_HOST), and perhap

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-17 Thread Stefano Brivio
On Wed, 15 Jul 2020 16:33:56 +0200 Florian Westphal wrote: > Stefano Brivio wrote: > > On Wed, 15 Jul 2020 14:42:58 +0200 > > Florian Westphal wrote: > > > With your skeleton patch, br0 updates MTU, but the sender still > > > won't know that unless inpu

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-15 Thread Stefano Brivio
On Wed, 15 Jul 2020 14:42:58 +0200 Florian Westphal wrote: > Stefano Brivio wrote: > > I would still like the idea I proposed better (updating MTUs down the > > chain), it's simpler and we don't have to duplicate existing > > functionality (generating addit

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-15 Thread Stefano Brivio
Hi Aaron, On Tue, 14 Jul 2020 16:38:29 -0400 Aaron Conole wrote: > Numan Siddique writes: > > > On Mon, Jul 13, 2020 at 3:34 PM Stefano Brivio wrote: > >> > >> On Mon, 13 Jul 2020 10:04:13 +0200 > >> Florian Westphal wrote: > >&g

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-14 Thread Stefano Brivio
On Mon, 13 Jul 2020 16:02:19 +0200 Florian Westphal wrote: > AFAICS everyhing functions as designed, except: > 1. The route exception should not exist in first place in this case > 2. The route exception never times out (gets refreshed every time >tunnel tries to send a mtu-sized packet). > 3

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-14 Thread Stefano Brivio
On Mon, 13 Jul 2020 18:22:55 +0200 Florian Westphal wrote: > Stefano Brivio wrote: > > > so, packets coming in on the bridge (local tx or from remote bridge port) > > > can have the enap header (50 bytes) prepended without exceeding the > > > physical link mt

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-13 Thread Stefano Brivio
On Mon, 13 Jul 2020 16:59:11 +0200 Florian Westphal wrote: > Its configured properly: > > ovs bridge mtu: 1450 > vxlan device mtu: 1450 > physical link: 1500 Okay, so my proposal to reflect the discovered PMTU on the MTU of the VXLAN device won't help in your case. In the test case I drafted,

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-13 Thread Stefano Brivio
On Mon, 13 Jul 2020 10:04:13 +0200 Florian Westphal wrote: > Stefano Brivio wrote: > > Hi, > > > > On Sun, 12 Jul 2020 22:07:03 +0200 > > Florian Westphal wrote: > > > > > vxlan and geneve take the to-be-transmitted skb, prepend the >

Re: [PATCH net-next 0/3] vxlan, geneve: allow to turn off PMTU updates on encap socket

2020-07-12 Thread Stefano Brivio
On Sun, 12 Jul 2020 22:07:02 +0200 Florian Westphal wrote: > There are existing deployments where a vxlan or geneve interface is part > of a bridge. > > In this case, MTU may look like this: > > bridge mtu: 1450 > vxlan (bridge port) mtu: 1450 > other bridge ports: 1450 > > physical link (used

Re: [PATCH net-next 1/3] udp_tunnel: allow to turn off path mtu discovery on encap sockets

2020-07-12 Thread Stefano Brivio
Hi, On Sun, 12 Jul 2020 22:07:03 +0200 Florian Westphal wrote: > vxlan and geneve take the to-be-transmitted skb, prepend the > encapsulation header and send the result. > > Neither vxlan nor geneve can do anything about a lowered path mtu > except notifying the peer/upper dst entry. It could,

Re: [PATCH net] geneve: allow changing DF behavior after creation

2020-06-18 Thread Stefano Brivio
On Thu, 18 Jun 2020 15:03:47 +0200 Sabrina Dubroca wrote: > 2020-06-18, 12:26:29 +0200, Stefano Brivio wrote: > > On Thu, 18 Jun 2020 12:13:22 +0200 > > Sabrina Dubroca wrote: > > > > > Currently, trying to change the DF parameter of a geneve device does > &

Re: [PATCH net] geneve: allow changing DF behavior after creation

2020-06-18 Thread Stefano Brivio
risingly given the name, is not called from geneve_changelink(). Did you consider factoring out (at least) this block to have it shared? Either way, Reviewed-by: Stefano Brivio -- Stefano

Re: Good idea to rename files in include/uapi/ ?

2020-06-14 Thread Stefano Brivio
On Sun, 14 Jun 2020 21:41:17 +0200 "Alexander A. Klimov" wrote: > Hello there! > > At the moment one can't checkout a clean working directory w/o any > changed files on a case-insensitive FS as the following file names have > lower-case duplicates: They are not duplicates: matching extensions

Re: [PATCH net] net: openvswitch: free vport unless register_netdevice() succeeds

2019-10-22 Thread Stefano Brivio
Hi Jakub, On Tue, 22 Oct 2019 14:53:16 -0700 Jakub Kicinski wrote: > On Mon, 21 Oct 2019 12:01:57 +0200, Stefano Brivio wrote: > > From: Hillf Danton > > > > syzbot found the following crash on: > > > The function in net core, register_netdevice(), may fai

Re: [PATCH net] net: openvswitch: free vport unless register_netdevice() succeeds

2019-10-21 Thread Stefano Brivio
On Mon, 21 Oct 2019 19:08:01 +0800 Hillf Danton wrote: > Hey Stefano > > On Mon, 21 Oct 2019 18:02:48 +0800 Stefano Brivio wrote: > > > > --- > > This patch was sent to d...@openvswitch.org and appeared on netdev > > only as Pravin replied to it, giv

[PATCH net] net: openvswitch: free vport unless register_netdevice() succeeds

2019-10-21 Thread Stefano Brivio
orted. It is fixed by releasing vport unless device is registered successfully. To do that, the callback assignment is defered until device is registered. Reported-by: syzbot+13210896153522fe1...@syzkaller.appspotmail.com Fixes: 309b66970ee2 ("net: openvswitch: do not free vport if regist

[PATCH net v2] ipv4: Return -ENETUNREACH if we can't create route but saddr is valid

2019-10-16 Thread Stefano Brivio
#x27;t resolve the route, and this appears to be rather inconsistent. Reported-by: Stefan Walter Analysed-by: Benjamin Coddington Analysed-by: Gonzalo Siero Signed-off-by: Stefano Brivio --- v2: No changes, submitting for net instead of net-next and removing explanation why v1 was targeted for

Re: [PATCH net-next] ipv4: Return -ENETUNREACH if we can't create route but saddr is valid

2019-10-16 Thread Stefano Brivio
On Wed, 16 Oct 2019 14:21:59 -0400 (EDT) David Miller wrote: > From: Stefano Brivio > Date: Thu, 10 Oct 2019 17:51:50 +0200 > > > I think this should be considered for -stable, < 5.2 > > Changes meant for -stable should not target net-next, but rather net. Oh, s

[PATCH net-next] ipv4: Return -ENETUNREACH if we can't create route but saddr is valid

2019-10-10 Thread Stefano Brivio
ENETUNREACH if the device is down, but -EINVAL if the source address is specified and we can't resolve the route, and this appears to be rather inconsistent. Reported-by: Stefan Walter Analysed-by: Benjamin Coddington Analysed-by: Gonzalo Siero Signed-off-by: Stefano Brivio --- I think this

[PATCH net-next] ipv6: Don't use dst gateway directly in ip6_confirm_neigh()

2019-09-09 Thread Stefano Brivio
ckets on raw sockets destined to a directly connected host. However, directly using the dst gateway here is not consistent anymore with neighbour resolution, and, in general, as we want the next hop, using rt6_nexthop() looks like the only sane way to fetch it. Reported-by: Guillaume Nault Signed-of

Re: [PATCH net v2] net/sched: pfifo_fast: fix wrong dereference when qdisc is reset

2019-08-27 Thread Stefano Brivio
+0xc8/0x140 > __arm64_sys_sendmsg+0x74/0xa8 > el0_svc_handler+0x164/0x468 > el0_svc+0x10/0x14 > Code: 910012a0 92400801 d343fc03 11000c21 (38fb6863) > > Fix this by testing the value of 'TCQ_F_CPUSTATS' bit in 'qdisc->flags', > before derefere

Re: [PATCH net] net/sched: pfifo_fast: fix wrong dereference when qdisc is reset

2019-08-27 Thread Stefano Brivio
On Tue, 27 Aug 2019 01:15:16 +0200 Davide Caratti wrote: > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c > index 11c03cf4aa74..c89b787785a1 100644 > --- a/net/sched/sch_generic.c > +++ b/net/sched/sch_generic.c > @@ -688,12 +688,14 @@ static void pfifo_fast_reset(struct Qdisc *qd

Re: [net PATCH] net: route dump netlink NLM_F_MULTI flag missing

2019-08-23 Thread Stefano Brivio
l, we'll just fail, so that will never be a multipart message. > [0] https://github.com/vishvananda/netlink/ > [1] https://github.com/cilium/ > > Fixes: ee28906fd7a14 ("ipv4: Dump route exceptions if requested") > Signed-off-by: John Fastabend Reviewed-by: Stefano Brivio -- Stefano

Re: [PATCH net] ipv6: Fix return value of ipv6_mc_may_pull() for malformed packets

2019-08-19 Thread Stefano Brivio
Hi, On Wed, 14 Aug 2019 12:58:58 -0400 (EDT) David Miller wrote: > From: Stefano Brivio > Date: Tue, 13 Aug 2019 00:46:01 +0200 > > > Commit ba5ea614622d ("bridge: simplify ip_mc_check_igmp() and > > ipv6_mc_check_mld() calls") replaces direct

Re: [PATCH net] ipv4/route: do not check saddr dev if iif is LOOPBACK_IFINDEX

2019-08-12 Thread Stefano Brivio
On Sun, 11 Aug 2019 20:49:18 -0700 (PDT) David Miller wrote: > From: David Ahern > Date: Thu, 1 Aug 2019 22:16:00 -0600 > > > On 8/1/19 10:13 PM, Hangbin Liu wrote: > >> On Thu, Aug 01, 2019 at 01:51:25PM -0600, David Ahern wrote: > >>> On 8/1/19 2:29 AM, Hangbin Liu wrote: > Jianlin

[PATCH net] ipv6: Fix return value of ipv6_mc_may_pull() for malformed packets

2019-08-12 Thread Stefano Brivio
3b78a9ed64 ("ip: fix ip_mc_may_pull() return value"). I don't have a reproducer for this, unlike the one referred to by the IPv4 commit, but this is clearly broken. Fixes: ba5ea614622d ("bridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() calls") Signed-off-by: Ste

Re: [PATCH net] ipv4/route: do not check saddr dev if iif is LOOPBACK_IFINDEX

2019-08-02 Thread Stefano Brivio
David, On Thu, 1 Aug 2019 13:51:25 -0600 David Ahern wrote: > On 8/1/19 2:29 AM, Hangbin Liu wrote: > > Jianlin reported a bug that for IPv4, ip route get from src_addr would fail > > if src_addr is not an address on local system. > > > > \# ip route get 1.1.1.1 from 2.2.2.2 > > RTNETLINK answe

Re: Question about linux kernel commit: "net/ipv6: move metrics from dst to rt6_info"

2019-07-10 Thread Stefano Brivio
Jan, On Wed, 10 Jul 2019 12:59:41 + Jan Szewczyk wrote: > Hi! > I digged up a little further and maybe it's not a problem with MTU > itself. I checked every entry I get from RTM_GETROUTE netlink message > and after triggering "too big packet" by pinging ipv6address I get > exactly the same m

Re: [PATCH] ipv4: Fix off-by-one in route dump counter without netlink strict checking

2019-06-29 Thread Stefano Brivio
On Sat, 29 Jun 2019 19:55:08 +0200 Stefano Brivio wrote: > Always increment the per-node counter by one if we previously dumped > a regular route, so that it matches the current skip counter. > > Fixes: ee28906fd7a1 ("ipv4: Dump route exceptions if requested") > Sign

[PATCH] ipv4: Fix off-by-one in route dump counter without netlink strict checking

2019-06-29 Thread Stefano Brivio
st as it was before commit b964641e9925 ("selftests: pmtu: Make list_flush_ipv6_exception test more demanding"). Always increment the per-node counter by one if we previously dumped a regular route, so that it matches the current skip counter. Fixes: ee28906fd7a1 ("ipv4: Dump route

Re: [PATCH net] ipv6: fix suspicious RCU usage in rt6_dump_route()

2019-06-26 Thread Stefano Brivio
On Wed, 26 Jun 2019 03:05:28 -0700 Eric Dumazet wrote: > syzbot reminded us that rt6_nh_dump_exceptions() needs to be called > with rcu_read_lock() > > net/ipv6/route.c:1593 suspicious rcu_dereference_check() usage! Thanks for fixing this too. Reviewed-by: Stefano Brivio -- Stefano

Re: [PATCH net] ipv4: fix suspicious RCU usage in fib_dump_info_fnhe()

2019-06-26 Thread Stefano Brivio
(bucket) > + err = fnhe_dump_bucket(net, skb, cb, table_id, bucket, > +genid, fa_index, fa_start); > + rcu_read_unlock(); > if (err) > return err; > } Either way, Reviewed-by: Stefano Brivio -- Stefano

Re: [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop

2019-06-25 Thread Stefano Brivio
On Tue, 25 Jun 2019 12:47:38 -0700 (PDT) David Miller wrote: > From: Stephen Suryaputra > Date: Mon, 24 Jun 2019 20:14:06 -0400 > > > In commit 19e4e768064a8 ("ipv4: Fix raw socket lookup for local > > traffic"), the dif argument to __raw_v4_lookup() is coming from the > > returned value of ine

Re: [PATCH iproute2] iproute: Pass RTM_F_CLONED on dump to fetch cached routes to be flushed

2019-06-25 Thread Stefano Brivio
On Mon, 24 Jun 2019 15:55:49 -0600 David Ahern wrote: > On 6/14/19 7:33 PM, Stefano Brivio wrote: > > diff --git a/ip/iproute.c b/ip/iproute.c > > index 2b3dcc5dbd53..192442b42062 100644 > > --- a/ip/iproute.c > > +++ b/ip/iproute.c > > @@ -1602,6 +1602,16 @

[PATCH iproute2 v2] iproute: Set flags and attributes on dump to get IPv6 cached routes to be flushed

2019-06-25 Thread Stefano Brivio
separate 'filter' function dealing with RTM_F_CACHED only, use the existing iproute_dump_filter() and get table and oif kernel filtering for free. Suggested by David Ahern. Fixes: aba5acdfdb34 ("(Logical change 1.3)") Signed-off-by: Stefano Brivio --- ip/iproute.c | 5

Re: [PATCH iproute2] iproute: Pass RTM_F_CLONED on dump to fetch cached routes to be flushed

2019-06-24 Thread Stefano Brivio
Stephen, On Sat, 15 Jun 2019 03:33:50 +0200 Stefano Brivio wrote: > With a current (5.1) kernel version, IPv6 exception routes can't be listed > (ip -6 route list cache) or flushed (ip -6 route flush cache). I'm > re-introducing kernel support for this, but, to allow t

[PATCH net-next v7 11/11] selftests: pmtu: Make list_flush_ipv6_exception test more demanding

2019-06-21 Thread Stefano Brivio
, also ensure that no cached routes can be listed after flush, and remove 'sleep 1' calls, they are not actually needed. v7: No changes v6: - Merge this patch into series including fix, as it's also targeted for net-next. No actual changes Signed-off-by: Stefano Brivio ---

[PATCH net-next v7 05/11] Revert "net/ipv6: Bail early if user only wants cloned entries"

2019-06-21 Thread Stefano Brivio
This reverts commit 08e814c9e8eb5a982cbd1e8f6bd255d97c51026f: as we are preparing to fix listing and dumping of IPv6 cached routes, we need to allow RTM_F_CLONED as a flag to match routes against while dumping them. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- v7: No changes v6

[PATCH net-next v7 06/11] ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del()

2019-06-21 Thread Stefano Brivio
sociated to the originating route. Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects") Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- v7: No changes v6: New patch net/ipv6/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/r

[PATCH net-next v7 08/11] ipv6: Dump route exceptions if requested

2019-06-21 Thread Stefano Brivio
age, the dump will not terminate, as suggested by Martin Lau. This is a concrete possibility, setting up a big number of exceptions for the same route actually causes the issue, suggested by David Ahern. Reported-by: Jianlin Shi Fixes: 2b760fcf5cfb ("ipv6: hook up exception table

[PATCH net-next v7 02/11] ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering

2019-06-21 Thread Stefano Brivio
tes, we need to give userspace a way to request them. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- v7: No changes v6: Rebase onto net-next, no changes v5: No changes v4: New patch net/ipv4/fib_frontend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net

[PATCH net-next v7 10/11] selftests: pmtu: Introduce list_flush_ipv4_exception test case

2019-06-21 Thread Stefano Brivio
Signed-off-by: Stefano Brivio --- tools/testing/selftests/net/pmtu.sh | 60 + 1 file changed, 60 insertions(+) diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh index 269e839b747e..f5004a9df229 100755 --- a/tools/testing/selfte

[PATCH net-next v7 09/11] ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1()

2019-06-21 Thread Stefano Brivio
ccdb ("ipv6: prepare fib6_locate() for exception table") Signed-off-by: Stefano Brivio --- v7: No changes v6: Rebased onto net-next, no changes v5: No changes v4: No changes v3: No changes v2: No changes net/ipv6/ip6_fib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(

[PATCH net-next v7 07/11] ipv6/route: Change return code of rt6_dump_route() for partial node dumps

2019-06-21 Thread Stefano Brivio
urn 0, as we were unable to dump the single route in the node, but we're not done with it. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- v7: No changes v6: New patch net/ipv6/ip6_fib.c | 2 +- net/ipv6/route.c | 16 ++-- 2 files changed, 11 insertions(+), 7

[PATCH net-next v7 04/11] ipv4: Dump route exceptions if requested

2019-06-21 Thread Stefano Brivio
t chains in nexthop objects (suggested by David Ahern) v6: - Rebased onto net-next - Loop over nexthop paths too. Move loop over fnhe buckets to route.c, avoids need to export rt_fill_info() and to touch exceptions from fib_trie.c. Pass NULL as flow to rt_fill_info(), it now a

[PATCH net-next v7 03/11] ipv4/route: Allow NULL flowinfo in rt_fill_info()

2019-06-21 Thread Stefano Brivio
winfo. v7: If fl4 is NULL, explicitly set r->rtm_tos to 0: it's not initialised otherwise (spotted by David Ahern) v6: New patch Suggested-by: David Ahern Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- net/ipv4/route.c | 56 ++-

[PATCH net-next v7 00/11] Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions

2019-06-21 Thread Stefano Brivio
rt6_dump_route() v2: Add count of routes handled in partial dumps, and skip them, in patch 1/2. Stefano Brivio (11): fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering ipv4/route: Allow NULL flo

[PATCH net-next v7 01/11] fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED

2019-06-21 Thread Stefano Brivio
is set. Skip filtering altogether if no strict checking is requested: selecting routes or exceptions only would be inconsistent with the fact we can't filter on tables. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- include/net/ip_fib.h| 2 ++ net/ipv4/fib_fronten

Re: [PATCH net-next v6 08/11] ipv6: Dump route exceptions if requested

2019-06-20 Thread Stefano Brivio
On Thu, 20 Jun 2019 08:24:22 -0600 David Ahern wrote: > On 6/19/19 5:59 PM, Stefano Brivio wrote: > > + if (filter->dump_exceptions) { > > + struct fib6_nh_exception_dump_walker w = { .dump = arg, > > +

Re: [PATCH net-next v6 06/11] ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del()

2019-06-20 Thread Stefano Brivio
On Thu, 20 Jun 2019 08:16:28 -0600 David Ahern wrote: > On 6/19/19 5:59 PM, Stefano Brivio wrote: > > If fc_nh_id isn't set, we shouldn't try to match against it. This > > actually matters just for the RTF_CACHE case below (where this is > > already handled): if

Re: [PATCH net-next v6 04/11] ipv4: Dump route exceptions if requested

2019-06-20 Thread Stefano Brivio
On Thu, 20 Jun 2019 07:31:32 -0600 David Ahern wrote: > On 6/19/19 5:59 PM, Stefano Brivio wrote: > > diff --git a/include/net/route.h b/include/net/route.h > > index 065b47754f05..e7f65388a6d4 100644 > > --- a/include/net/route.h > > +++ b/include/net/route.h > &g

Re: [PATCH net-next v6 03/11] ipv4/route: Allow NULL flowinfo in rt_fill_info()

2019-06-20 Thread Stefano Brivio
On Thu, 20 Jun 2019 07:15:55 -0600 David Ahern wrote: > On 6/19/19 5:59 PM, Stefano Brivio wrote: > > In the next patch, we're going to use rt_fill_info() to dump exception > > routes upon RTM_GETROUTE with NLM_F_ROOT, meaning userspace is requesting > > a dump and not

[PATCH net-next v6 11/11] selftests: pmtu: Make list_flush_ipv6_exception test more demanding

2019-06-19 Thread Stefano Brivio
, also ensure that no cached routes can be listed after flush, and remove 'sleep 1' calls, they are not actually needed. v6: - Merge this patch into series including fix, as it's also targeted for net-next. No actual changes Signed-off-by: Stefano Brivio --- tools/testin

[PATCH net-next v6 08/11] ipv6: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
gle message, the dump will not terminate, as suggested by Martin Lau. This is a concrete possibility, setting up a big number of exceptions for the same route actually causes the issue, suggested by David Ahern. Reported-by: Jianlin Shi Fixes: 2b760fcf5cfb ("ipv6: hook up exce

[PATCH net-next v6 04/11] ipv4: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
ver fnhe buckets to route.c, avoids need to export rt_fill_info() and to touch exceptions from fib_trie.c. Pass NULL as flow to rt_fill_info(), it now allows that (all suggested by David Ahern) Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.") Signed-off-by: Stef

[PATCH net-next v6 10/11] selftests: pmtu: Introduce list_flush_ipv4_exception test case

2019-06-19 Thread Stefano Brivio
This test checks that route exceptions can be successfully listed and flushed using ip -6 route {list,flush} cache. v6: - Merge this patch into series including fix, as it's also targeted for net-next - Drop left-over print of 'ip route list cache | wc -l' Signed-off-by:

[PATCH net-next v6 02/11] ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering

2019-06-19 Thread Stefano Brivio
tes, we need to give userspace a way to request them. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- v6: Rebase onto net-next, no changes v5: No changes v4: New patch net/ipv4/fib_frontend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/fib_f

[PATCH net-next v6 01/11] fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED

2019-06-19 Thread Stefano Brivio
Skip filtering altogether if no strict checking is requested: selecting routes or exceptions only would be inconsistent with the fact we can't filter on tables. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- include/net/ip_fib.h| 2 ++ net/ipv4/fib_frontend.c | 8 +

[PATCH net-next v6 03/11] ipv4/route: Allow NULL flowinfo in rt_fill_info()

2019-06-19 Thread Stefano Brivio
winfo. Suggested-by: David Ahern Signed-off-by: Stefano Brivio --- v6: New patch net/ipv4/route.c | 57 ++-- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 66cbe8a7a168..052a80373b1d 100644 ---

[PATCH net-next v6 09/11] ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1()

2019-06-19 Thread Stefano Brivio
ccdb ("ipv6: prepare fib6_locate() for exception table") Signed-off-by: Stefano Brivio --- v6: Rebased onto net-next, no changes v5: No changes v4: No changes v3: No changes v2: No changes net/ipv6/ip6_fib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/

[PATCH net-next v6 05/11] Revert "net/ipv6: Bail early if user only wants cloned entries"

2019-06-19 Thread Stefano Brivio
This reverts commit 08e814c9e8eb5a982cbd1e8f6bd255d97c51026f: as we are preparing to fix listing and dumping of IPv6 cached routes, we need to allow RTM_F_CLONED as a flag to match routes against while dumping them. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- v6: No changes v5

[PATCH net-next v6 07/11] ipv6/route: Change return code of rt6_dump_route() for partial node dumps

2019-06-19 Thread Stefano Brivio
urn 0, as we were unable to dump the single route in the node, but we're not done with it. Signed-off-by: Stefano Brivio --- v6: New patch net/ipv6/ip6_fib.c | 2 +- net/ipv6/route.c | 16 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/net/ipv6/ip6_fib.c

[PATCH net-next v6 06/11] ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del()

2019-06-19 Thread Stefano Brivio
sociated to the originating route. Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects") Signed-off-by: Stefano Brivio --- v6: New patch net/ipv6/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c4d285fe

[PATCH net-next v6 00/11] Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions

2019-06-19 Thread Stefano Brivio
tches into smaller logical changes. v3: Drop check on RTM_F_CLONED and rework logic of return values of rt6_dump_route() v2: Add count of routes handled in partial dumps, and skip them, in patch 1/2. Stefano Brivio (11): fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_

Re: [PATCH net v5 5/6] ipv6: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
On Tue, 18 Jun 2019 09:19:53 -0600 David Ahern wrote: > On 6/18/19 7:20 AM, Stefano Brivio wrote: > > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > > index 0f60eb3a2873..7375f3b7d310 100644 > > --- a/net/ipv6/route.c > > +++ b/net/ipv6/route.c > > @@

Re: [PATCH net v5 3/6] ipv4: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
On Tue, 18 Jun 2019 08:48:23 -0600 David Ahern wrote: > > +++ b/net/ipv4/fib_trie.c > > @@ -2000,28 +2000,92 @@ void fib_free_table(struct fib_table *tb) > > call_rcu(&tb->rcu, __trie_free_rcu); > > } > > > > +static int fib_dump_fnhe_from_leaf(struct fib_alias *fa, struct sk_buff > > *sk

[PATCH net v5 6/6] ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1()

2019-06-18 Thread Stefano Brivio
ccdb ("ipv6: prepare fib6_locate() for exception table") Signed-off-by: Stefano Brivio --- v5: No changes v4: No changes v3: No changes v2: No changes net/ipv6/ip6_fib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6

[PATCH net v5 3/6] ipv4: Dump route exceptions if requested

2019-06-18 Thread Stefano Brivio
e2: iproute2 kernel 4.14.0 4.15.0 4.19.0 5.0.0 5.1.0 3.5-rc4 ++++ + 4.4 4.9 4.14 4.15 4.19 5.0 5.1 fixed ++++ + Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.&quo

[PATCH net v5 1/6] fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED

2019-06-18 Thread Stefano Brivio
cking is requested: selecting routes or exceptions only would be inconsistent with the fact we can't filter on tables. Suggested-by: David Ahern Signed-off-by: Stefano Brivio --- include/net/ip_fib.h| 2 ++ net/ipv4/fib_frontend.c | 8 +++- net/ipv6/ip6_fib.c | 3 ++- 3

  1   2   3   4   5   6   >