Re: [PATCH v2 4/9] net: ip6_redirect_no_header() - use new style struct initializer instead of memset

2018-10-01 Thread David Ahern
On 9/30/18 12:44 AM, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > (allows for better compiler optimization) > > Signed-off-by: Maciej Żenczykowski > --- > net/ipv6/route.c | 17 - > 1 file changed, 8 insertions(+), 9 deletions(-) > Reviewed-by: David Ahern

Re: [PATCH v2 3/9] net: ip6_redirect() - use new style struct initializer instead of memset

2018-10-01 Thread David Ahern
On 9/30/18 12:44 AM, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > (allows for better compiler optimization) > > Signed-off-by: Maciej Żenczykowski > --- > net/ipv6/route.c | 19 +-- > 1 file changed, 9 insertions(+), 10 deletions(-) > Reviewed-by: David Ahern

Re: [PATCH v2 1/9] net: ip_rt_get_source() - use new style struct initializer instead of memset

2018-10-01 Thread David Ahern
On 9/30/18 12:44 AM, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > (allows for better compiler optimization) > > Signed-off-by: Maciej Żenczykowski > --- > net/ipv4/route.c | 21 + > 1 file changed, 9 insertions(+), 12 deletions(-) > Reviewed-by: David Ahern

Re: [PATCH iproute2/net-next v2] tc_util: Add support for showing TCA_STATS_BASIC_HW statistics

2018-10-01 Thread David Ahern
On 10/1/18 4:29 AM, Eelco Chaudron wrote: >>> Hi Stephen, anything else required for this patch to be accepted? >>> >>> FYI the kernel side of this patch has been excepted on net-next. >>> >>> Cheers, >>> >>> Eelco >> >> D

Re: [PATCH net-next] rtnetlink: fix rtnl_fdb_dump() for shorter family headers

2018-10-01 Thread David Ahern
On 10/1/18 6:44 AM, Mauricio Faria de Oliveira wrote: >> I suspect rtnl_fdb_dump is forever stuck with the ifinfomsg struct as >> the header if any kernel side filtering is to be done. [snip] > > Why exactly? I understand currently there may be little information > to distinguish family

Re: [PATCH net-next] rtnetlink: fix rtnl_fdb_dump() for shorter family headers

2018-09-30 Thread David Ahern
On 9/28/18 1:35 PM, Mauricio Faria de Oliveira wrote: > Currently, rtnl_fdb_dump() assumes the family header is 'struct ifinfomsg', > which is not always true. For example, 'struct ndmsg' is used by iproute2 > as well (in the 'ip neigh' command). > > The problem is, the function bails out early

Re: [PATCH iproute2-next 01/11] libnetlink: Convert GETADDR dumps to use rtnl_addrdump_req

2018-09-30 Thread David Ahern
On 9/30/18 3:35 AM, Stephen Hemminger wrote: > On Sat, 29 Sep 2018 10:59:21 -0700 > David Ahern wrote: > >> From: David Ahern >> >> Add rtnl_addrdump_req for address dumps using the proper ifaddrmsg >> as the header. Convert existing RTM_GETADDR dumps to use it.

Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info

2018-09-30 Thread David Ahern
On 9/30/18 3:38 AM, Li RongQing wrote: >> >> I don't understand why you are doing this? It is not going to be >> faster (or safer) than container_of. container_of provides the >> same functionality and is safe against position of the member >> in the structure. >> > > In fact, most places are

[PATCH iproute2-next 03/11] libnetlink: Convert GETADDRLABEL dumps to use rtnl_addrlbldump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_addrlbldump_req for address label dumps using the proper ifaddrlblmsg as the header. Convert existing RTM_GETADDRALBEL dumps to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 2 ++ ip/ipaddrlabel.c | 4 ++-- lib/libnetlink.c | 17

[PATCH iproute2-next 02/11] libnetlink: Convert GETROUTE dumps to use rtnl_routedump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_routedump_req for route dumps using the proper rtmsg as the header. Convert existing RTM_GETROUTE dumps to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 2 ++ ip/ipmroute.c| 2 +- ip/iproute.c | 4 ++-- lib/libnetlink.c | 16

[PATCH iproute2-next 05/11] libnetlink: Convert GETNETCONF dumps to use rtnl_netconfdump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_netconfdump_req for netconf dumps using the proper netconfmsg as the header. Convert existing RTM_GETNETCONF dumps to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 2 ++ ip/ipnetconf.c | 3 +-- lib/libnetlink.c | 16 3

[PATCH iproute2-next 04/11] libnetlink: Convert GETMDB dumps to use rtnl_mdbdump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_mdbdump_req for mdb dumps using the proper br_port_msg as the header. Convert existing RTM_GETMDB dumps to use it. Signed-off-by: David Ahern --- bridge/mdb.c | 2 +- include/libnetlink.h | 2 ++ lib/libnetlink.c | 17 + 3 files changed

[PATCH iproute2-next 08/11] libnetlink: Convert GETNEIGHTBL dumps to use rtnl_neightbldump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_neightbldump_req for neighbor table dumps using the proper ndtmsg as the header. Convert existing RTM_GETNEIGHTBL dumps to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 2 ++ ip/ipntable.c| 2 +- lib/libnetlink.c | 16

[PATCH iproute2-next 07/11] libnetlink: Convert GETNEIGH dumps to use rtnl_neighdump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_neighdump_req for neighbor dumps using the proper ndmsg as the header. Convert existing rtnl_wilddump_request for RTM_GETNEIGH to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 2 ++ lib/libnetlink.c | 16 misc/arpd.c

[PATCH iproute2-next 06/11] libnetlink: Convert GETRULE dumps to use rtnl_ruledump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_ruledump_req for fib fule dumps using the proper fib_rule_hdr as the header. Convert existing RTM_GETRULE dumps to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 2 ++ ip/iprule.c | 2 +- lib/libnetlink.c | 17 + 3 files

[PATCH iproute2-next 01/11] libnetlink: Convert GETADDR dumps to use rtnl_addrdump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_addrdump_req for address dumps using the proper ifaddrmsg as the header. Convert existing RTM_GETADDR dumps to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 4 ip/ipaddress.c | 6 +++--- lib/libnetlink.c | 16 3

[PATCH iproute2-next 10/11] libnetlink: Rename rtnl_wilddump_* to rtnl_linkdump_*

2018-09-29 Thread David Ahern
From: David Ahern Rename rtnl_wilddump_req_filter to rtnl_linkdump_req_filter, rtnl_wilddump_request to rtnl_linkdump_request and rtnl_wilddump_req_filter_fn to rtnl_linkdump_req_filter_fn. In all cases drop the type argument which at this point is only RTM_GETLINK and hardcode in the functions

[PATCH iproute2-next 09/11] libnetlink: Convert GETNSID dumps to use rtnl_nsiddump_req

2018-09-29 Thread David Ahern
From: David Ahern Add rtnl_nsiddump_req for namespace id dumps using the proper rtgenmsg as the header. Convert existing RTM_GETNSID dumps to use it. Signed-off-by: David Ahern --- include/libnetlink.h | 2 ++ ip/ipnetns.c | 2 +- lib/libnetlink.c | 16 3 files

[PATCH iproute2-next 11/11] libnetlink: Rename rtnl_wilddump_stats_req_filter to rtnl_statsdump_req_filter

2018-09-29 Thread David Ahern
From: David Ahern rtnl_wilddump_stats_req_filter only takes RTM_GETSTATS as the type argument so rename to rtnl_statsdump_req_filter for consistency with other request functions and hardcode the type argument. Signed-off-by: David Ahern --- bridge/vlan.c| 8 ++-- include

[PATCH iproute2-next 00/11] Fix dump requests to use proper header for type

2018-09-29 Thread David Ahern
From: David Ahern iproute2 currently uses ifinfomsg as the header for all dumps using the wilddump headers. This is wrong as each message type actually has its own header type. While the kernel has traditionally let it go as it for the most part only uses the family entry, the use of kernel side

[PATCH net] rtnetlink: Fail dump if target netnsid is invalid

2018-09-28 Thread David Ahern
From: David Ahern Link dumps can return results from a target namespace. If the namespace id is invalid, then the dump request should fail if get_target_net fails rather than continuing with a dump of the current namespace. Fixes: 79e1ad148c844 ("rtnetlink: use netnsid to query inte

Re: [PATCH RFC net-next 4/5] net/ipv4: Update inet_dump_ifaddr to support NLM_F_DUMP_PROPER_HDR

2018-09-28 Thread David Ahern
On 9/28/18 12:41 PM, Christian Brauner wrote: >> @@ -1683,15 +1683,45 @@ static int inet_dump_ifaddr(struct sk_buff *skb, >> struct netlink_callback *cb) >> s_idx = idx = cb->args[1]; >> s_ip_idx = ip_idx = cb->args[2]; >> >> -if (nlmsg_parse(cb->nlh, sizeof(struct ifaddrmsg), tb,

Re: [PATCH net-next] geneve: fix ttl inherit type

2018-09-28 Thread David Ahern
On 9/27/18 7:09 PM, Hangbin Liu wrote: > Phil pointed out that there is a mismatch between vxlan and geneve ttl > inherit. We should define it as a flag and use nla_put_flag to export this > opiton. > > Fixes: 52d0d404d39dd ("geneve: add ttl inherit support") same here .. getting an unknown

Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit

2018-09-28 Thread David Ahern
On 9/27/18 7:08 PM, Hangbin Liu wrote: > Phil pointed out that there is a mismatch between vxlan and geneve ttl > inherit. > We should define it as a flag and use nla_put_flag to export this opiton. > > Fixes: 8fd780698745b ("vxlan: fill ttl inherit info") Wrong Fixes tag:

Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit

2018-09-28 Thread David Ahern
On 9/28/18 6:38 AM, Hangbin Liu wrote: > On Fri, Sep 28, 2018 at 12:37:00PM +0200, Phil Sutter wrote: >> On Fri, Sep 28, 2018 at 09:08:26AM +0800, Hangbin Liu wrote: >>> Phil pointed out that there is a mismatch between vxlan and geneve ttl >>> inherit. >>> We should define it as a flag and use

Re: [PATCH iproute2 net-next] bridge: fdb: add support for sticky flag

2018-09-28 Thread David Ahern
On 9/27/18 7:35 AM, Nikolay Aleksandrov wrote: > Add support for the new sticky flag that can be set on fdbs and update the > man page. > > CC: David Ahern > Signed-off-by: Nikolay Aleksandrov > --- > bridge/fdb.c | 9 +++-- > man/man8/bridge.8 | 6 +

Re: [PATCH 04/11] net: ip6_multipath_l3_keys() - use new style struct initializer instead of memset

2018-09-28 Thread David Ahern
On 9/27/18 5:00 PM, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > Signed-off-by: Maciej Żenczykowski > --- > net/ipv6/route.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > index d28f83e01593..9cb024451fc5

Re: [PATCH 03/11] net: fib_multipath_hash() - use new style struct initializer instead of memset

2018-09-28 Thread David Ahern
On 9/27/18 5:00 PM, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > Signed-off-by: Maciej Żenczykowski > --- > net/ipv4/route.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > index 048919713f4e..17953a52fbd0

Re: [PATCH iproute2 net-next] ipneigh: support setting of NTF_ROUTER on neigh entries

2018-09-28 Thread David Ahern
On 9/25/18 3:15 PM, Roopa Prabhu wrote: > From: Roopa Prabhu > > Signed-off-by: Roopa Prabhu > --- > ip/ipneigh.c | 2 ++ > 1 file changed, 2 insertions(+) > applied to iproute2-next. And then I noticed you did not update the help or the man page. Please send a follow up.

Re: [Patch net-next] net_sched: fix an extack message in tcf_block_find()

2018-09-27 Thread David Ahern
On 9/27/18 3:36 PM, Cong Wang wrote: > On Thu, Sep 27, 2018 at 2:16 PM Eric Dumazet wrote: >> >> >> >> On 09/27/2018 01:42 PM, Cong Wang wrote: >>> It is clearly a copy-n-paste. >>> >>> Signed-off-by: Cong Wang >>> --- >>> net/sched/cls_api.c | 2 +- >>> 1 file changed, 1 insertion(+), 1

Re: [PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2

2018-09-27 Thread David Ahern
On 9/27/18 11:58 AM, Christian Brauner wrote: > Various userspace programs (e.g. iproute2) have sent RTM_GETADDR > requests with struct ifinfomsg. This is wrong and should have been > struct ifaddrmsg all along as mandated by the manpages. However, dump > requests so far didn't parse the netlink

Re: [PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2

2018-09-27 Thread David Ahern
On 9/27/18 11:58 AM, Christian Brauner wrote: > Various userspace programs (e.g. iproute2) have sent RTM_GETADDR > requests with struct ifinfomsg. This is wrong and should have been > struct ifaddrmsg all along as mandated by the manpages. However, dump > requests so far didn't parse the netlink

Re: [PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2

2018-09-27 Thread David Ahern
On 9/27/18 11:58 AM, Christian Brauner wrote: > Various userspace programs (e.g. iproute2) have sent RTM_GETADDR > requests with struct ifinfomsg. This is wrong and should have been > struct ifaddrmsg all along as mandated by the manpages. However, dump > requests so far didn't parse the netlink

Re: [RFC PATCH iproute2-next V2] man: Add devlink exception man page

2018-09-27 Thread David Ahern
On 9/27/18 8:32 AM, Jiri Pirko wrote: > But still, I need the code so I can play with it, to > see the outputs etc. +1

Re: netlink: 16 bytes leftover after parsing attributes in process `ip'.

2018-09-26 Thread David Ahern
On 9/25/18 11:51 PM, Jiri Benc wrote: > On Tue, 25 Sep 2018 09:37:41 -0600, David Ahern wrote: >> For ifaddrmsg ifa_flags aligns with ifi_type which is set by kernel side >> so this should be ok. > > Does the existing user space set ifi_type to anything? Does it zero out >

Re: [PATCH 2/2] net-ipv4: remove 2 always zero parameters from ipv4_redirect()

2018-09-25 Thread David Ahern
> net/xfrm/xfrm_interface.c | 2 +- > 11 files changed, 14 insertions(+), 15 deletions(-) Reviewed-by: David Ahern

Re: [PATCH 1/2] net-ipv4: remove 2 always zero parameters from ipv4_update_pmtu()

2018-09-25 Thread David Ahern
| 8 +++- > net/ipv6/sit.c | 2 +- > net/netfilter/ipvs/ip_vs_core.c | 3 +-- > net/xfrm/xfrm_interface.c | 2 +- > 12 files changed, 14 insertions(+), 18 deletions(-) > Reviewed-by: David Ahern

Re: [PATCH net-next v1 1/5] net: allow binding socket in a VRF when there's an unbound socket

2018-09-25 Thread David Ahern
On 9/25/18 9:26 AM, Mike Manning wrote: > On 24/09/2018 23:44, David Ahern wrote: >> On 9/24/18 10:13 AM, Mike Manning wrote: >>> From: Robert Shearman >>> >>> There is no easy way currently for applications that want to receive >>> packets in the def

Re: netlink: 16 bytes leftover after parsing attributes in process `ip'.

2018-09-25 Thread David Ahern
On 9/25/18 8:47 AM, Jiri Benc wrote: > On Tue, 25 Sep 2018 11:49:10 +0200, Christian Brauner wrote: >> So if people really want to hide this issue as much as we can then we >> can play the guessing game. I could send a patch that roughly does the >> following: >> >> if (nlmsg_len(cb->nlh) <

netlink: 16 bytes leftover after parsing attributes in process `ip'.

2018-09-24 Thread David Ahern
On top of net-next I am see a dmesg error: netlink: 16 bytes leftover after parsing attributes in process `ip'. I traced it to address lists and commit: commit 6ecf4c37eb3e89b0832c9616089a5cdca3747da7 Author: Christian Brauner Date: Tue Sep 4 21:53:50 2018 +0200 ipv6: enable

Re: [PATCH net-next v1 2/5] ipv6: allow link-local and multicast packets inside vrf

2018-09-24 Thread David Ahern
On 9/24/18 10:13 AM, Mike Manning wrote: > Packets that are multicast or to link-local addresses are not enslaved > to the vrf of the socket that they are received on. This is needed for > NDISC, but breaks applications that rely on receiving such packets when > in a VRF. Also to make IPv6

Re: [PATCH net-next v1 5/5] ipv6: add vrf table handling code for ipv6 mcast

2018-09-24 Thread David Ahern
table *rt' declaration removed the rest of the change looks fine. Reviewed-by: David Ahern

Re: [PATCH net-next v1 4/5] ipv6: do not drop vrf udp multicast packets

2018-09-24 Thread David Ahern
On 9/24/18 10:13 AM, Mike Manning wrote: > From: Dewi Morgan > > For bound udp sockets in a vrf, also check the sdif to get the index > for ingress devices enslaved to an l3mdev. Verify the multicast address > against the enslaved rather than the l3mdev device. > > Signed-off-by: Dewi Morgan >

Re: [PATCH net-next v1 3/5] ipv4: Allow sending multicast packets on specific i/f using VRF socket

2018-09-24 Thread David Ahern
arman > Signed-off-by: Mike Manning > --- > net/ipv4/datagram.c | 2 +- > net/ipv4/ping.c | 2 +- > net/ipv4/raw.c | 2 +- > net/ipv4/udp.c | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > Reviewed-by: David Ahern

Re: [PATCH net-next v1 1/5] net: allow binding socket in a VRF when there's an unbound socket

2018-09-24 Thread David Ahern
On 9/24/18 10:13 AM, Mike Manning wrote: > From: Robert Shearman > > There is no easy way currently for applications that want to receive > packets in the default VRF to be isolated from packets arriving in > VRFs, which makes using VRF-unaware applications in a VRF-aware system > a potential

Re: [PATCH net-next v1 5/5] ipv6: add vrf table handling code for ipv6 mcast

2018-09-24 Thread David Ahern
just started looking at this set. Compiler notes one problem: On 9/24/18 10:13 AM, Mike Manning wrote: > @@ -2146,6 +2157,7 @@ static void ip6_mr_forward(struct net *net, struct > mr_table *mrt, > > int ip6_mr_input(struct sk_buff *skb) > { > + struct rtable *rt = skb_rtable(skb); The

Re: [PATCH nf] netfilter: avoid erronous array bounds warning

2018-09-24 Thread David Ahern
is by adding an explicit WARN_ON_ONCE() check. > > This patch has no effect if the family is a compile-time constant as gcc > will remove the switch() construct entirely. > > Reported-by: David Ahern > Signed-off-by: Florian Westphal > --- > include/linux/netfilter.h | 2

Re: [PATCH iproute2] Makefile: add help target

2018-09-21 Thread David Ahern
On 9/21/18 9:16 AM, Stephen Hemminger wrote: > Add help target to Makefile. > > Signed-off-by: Stephen Hemminger > --- > Makefile | 12 > 1 file changed, 12 insertions(+) > Acked-by: David Ahern

Re: [PATCH net] net/ipv4: avoid compile error in fib_info_nh_uses_dev

2018-09-21 Thread David Ahern
Move device validation to helper") > Signed-off-by: Eric Dumazet > Cc: David Ahern > --- > net/ipv4/fib_frontend.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c &g

Re: [PATCH ipsec] net: xfrm: pass constant family to nf_hook function

2018-09-21 Thread David Ahern
On 9/21/18 8:55 AM, Florian Westphal wrote: > David Ahern wrote: >>> David, i hope this will silence the warning, would be nice >>> if you could test it. >> >> I still the warning. > > Wait. Do you see this warning everywhere or just in xfrm? > just the one file.

Re: [PATCH ipsec] net: xfrm: pass constant family to nf_hook function

2018-09-21 Thread David Ahern
ould be to increase hooks_arp[] size, but that > increases struct net size needlesly. > > Reported-by: David Ahern > Signed-off-by: Florian Westphal > --- > David, i hope this will silence the warning, would be nice > if you could test it. I still the warning. > >

Re: [PATCH net-next 0/5] vrf: allow simultaneous service instances in default and other VRFs

2018-09-20 Thread David Ahern
On 9/20/18 1:58 AM, Mike Manning wrote: > Services currently have to be VRF-aware if they are using an unbound > socket. One cannot have multiple service instances running in the > default and other VRFs for services that are not VRF-aware and listen > on an unbound socket. This is because there

Re: [PATCH iproute2-next] iplink: add ipvtap support

2018-09-20 Thread David Ahern
On 9/18/18 8:03 PM, Hangbin Liu wrote: > IPVLAN and IPVTAP are using the same functions and parameters. So we can > just add a new link_util with id ipvtap. Others are the same. > > Signed-off-by: Hangbin Liu > --- > ip/iplink.c | 4 ++-- > ip/iplink_ipvlan.c| 28

Re: array bounds warning in xfrm_output_resume

2018-09-20 Thread David Ahern
On 9/20/18 7:06 AM, Florian Westphal wrote: > David Ahern wrote: >>> $ make O=kbuild/perf -j 24 -s >>> In file included from /home/dsa/kernel-3.git/include/linux/kernel.h:10:0, >>> from /home/dsa/kernel-3.git/include/linux/list.h:9, >>>

Re: [PATCH net-next v3 1/2] netlink: ipv4 igmp join notifications

2018-09-19 Thread David Ahern
On 9/18/18 6:12 AM, Patrick Ruddy wrote: > > I've hit a small snag with adding the new groups. The number of defined > groups currently sits at 31 so I can only add one before hitting the I believe you have no more available. RTNLGRP_* has been defined from 0 (RTNLGRP_NONE) to 31

Re: [PATCH net-next] ipv6: Allow the l3mdev to be a loopback

2018-09-19 Thread David Ahern
net/ipv6/route.c | 3 ++- > 3 files changed, 5 insertions(+), 2 deletions(-) > Reviewed-by: David Ahern Been on my to-do list for a while. Thanks for the patch. This resolves, for example, a harmless error message from the 'host' command from bind9-host-9.10.3 which probes fo

Re: array bounds warning in xfrm_output_resume

2018-09-19 Thread David Ahern
On 6/18/18 11:10 AM, David Ahern wrote: > Florian: > > I am seeing this warning: > > $ make O=kbuild/perf -j 24 -s > In file included from /home/dsa/kernel-3.git/include/linux/kernel.h:10:0, > from /home/dsa/kernel-3.git/include/linux/list.h:9, >

Re: [PATCH net 2/2] ipv6: fix memory leak on dst->_metrics

2018-09-18 Thread David Ahern
st_metrics *)DST_METRICS_PTR(dst); > struct rt6_info *rt = (struct rt6_info *)dst; > struct fib6_info *from; > struct inet6_dev *idev; > > - dst_destroy_metrics_generic(dst); > + if (p != _default_metrics && refcount_dec_and_test(>refc

Re: [PATCH net 1/2] Revert "ipv6: fix double refcount of fib6_metrics"

2018-09-18 Thread David Ahern
> --- > net/ipv6/route.c | 4 > 1 file changed, 4 insertions(+) > Reviewed-by: David Ahern

Re: [RFC 1/5] netlink: remove NLA_NESTED_COMPAT

2018-09-18 Thread David Ahern
3 deletions(-) > Reviewed-by: David Ahern

Re: [RFC 2/5] netlink: set extack error message in nla_validate()

2018-09-18 Thread David Ahern
On 9/18/18 6:12 AM, Johannes Berg wrote: > diff --git a/lib/nlattr.c b/lib/nlattr.c > index 120ad569e13d..efbd6c1aff29 100644 > --- a/lib/nlattr.c > +++ b/lib/nlattr.c > @@ -181,9 +181,13 @@ int nla_validate(const struct nlattr *head, int len, int > maxtype, > int rem; > >

Re: [Patch net v2] net/ipv6: do not copy dst flags on rt init

2018-09-17 Thread David Ahern
size due to > DST_NOCOUNT not set and thus no counter decrements on gc-ed routes. > > Fixes: 3b6761d18bc1 ("net/ipv6: Move dst flags to booleans in fib entries") > Cc: David Ahern > Acked-by: Wei Wang > Signed-off-by: Peter Oskolkov > --- > net/ipv6/route.c | 2 -- >

Re: [PATCH net] net/ipv6: do not copy DST_NOCOUNT flag on rt init

2018-09-17 Thread David Ahern
On 9/17/18 9:11 AM, Peter Oskolkov wrote: > On Thu, Sep 13, 2018 at 9:11 PM David Ahern wrote: >> >> On 9/13/18 1:38 PM, Peter Oskolkov wrote: >> >>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c >>> index 3eed045c65a5..a3902f805305 100644 >>> -

Re: [PATCH net] net/ipv6: do not copy DST_NOCOUNT flag on rt init

2018-09-17 Thread David Ahern
On 9/17/18 9:11 AM, Peter Oskolkov wrote: > On Thu, Sep 13, 2018 at 9:11 PM David Ahern wrote: >> >> On 9/13/18 1:38 PM, Peter Oskolkov wrote: >> >>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c >>> index 3eed045c65a5..a3902f805305 100644 >>> -

Re: [PATCH net] netfilter: bridge: Don't sabotage nf_hook calls from an l3mdev

2018-09-16 Thread David Ahern
Pablo: DaveM has this marked as waiting for upstream. Any comment on this patch? Thanks, David On 9/7/18 3:08 PM, dsah...@kernel.org wrote: > From: David Ahern > > For starters, the bridge netfilter code registers operations that > are invoked any time nh_hook is called.

Re: [PATCH iproute2] libnetlink: fix leak and using unused memory on error

2018-09-16 Thread David Ahern
On 9/14/18 10:48 AM, Mahesh Bandewar (महेश बंडेवार) wrote: > On Thu, Sep 13, 2018 at 12:33 PM, Stephen Hemminger > wrote: >> If an error happens in multi-segment message (tc only) >> then report the error and stop processing further responses. >> This also fixes refering to the buffer after free.

Re: [PATCH net] net/ipv6: do not copy DST_NOCOUNT flag on rt init

2018-09-13 Thread David Ahern
On 9/13/18 1:38 PM, Peter Oskolkov wrote: > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > index 3eed045c65a5..a3902f805305 100644 > --- a/net/ipv6/route.c > +++ b/net/ipv6/route.c > @@ -946,7 +946,7 @@ static void ip6_rt_init_dst_reject(struct rt6_info *rt, > struct fib6_info *ort) > >

Re: [PATCH net] ipv6: use rt6_info members when dst is set in rt6_fill_node

2018-09-10 Thread David Ahern
On 9/10/18 7:04 PM, Hangbin Liu wrote: > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > index 18e00ce..62621b4 100644 > --- a/net/ipv6/route.c > +++ b/net/ipv6/route.c > @@ -998,6 +998,21 @@ static void ip6_rt_copy_init(struct rt6_info *rt, struct > fib6_info *ort) > rt->rt6i_prefsrc =

Re: [PATCH net] ipv6: use rt6_info members when dst is set in rt6_fill_node

2018-09-10 Thread David Ahern
On 9/10/18 11:55 AM, Xin Long wrote: > On Tue, Sep 11, 2018 at 12:13 AM David Ahern wrote: >> >> On 9/9/18 12:29 AM, Xin Long wrote: >>>>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c >>>>> index 18e00ce..e554922 100644 >>>

Re: [PATCH net] ipv6: use rt6_info members when dst is set in rt6_fill_node

2018-09-10 Thread David Ahern
On 9/9/18 12:29 AM, Xin Long wrote: >>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c >>> index 18e00ce..e554922 100644 >>> --- a/net/ipv6/route.c >>> +++ b/net/ipv6/route.c >>> @@ -4670,20 +4670,33 @@ static int rt6_fill_node(struct net *net, struct >>> sk_buff *skb, >>>

Re: [PATCH net] ipv6: use rt6_info members when dst is set in rt6_fill_node

2018-09-08 Thread David Ahern
On 9/8/18 3:24 AM, Xin Long wrote: > In inet6_rtm_getroute, since Commit 93531c674315 ("net/ipv6: separate > handling of FIB entries from dst based routes"), it has used rt->from > to dump route info instead of rt. > > However for some route like cache, its information is not the same as > that

Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace

2018-09-08 Thread David Ahern
Hi Thomas: On 9/7/18 12:52 PM, Thomas Haller wrote: > Hi David, > > > On Mon, 2018-09-03 at 20:54 -0600, David Ahern wrote: > >> From init_net: >> $ ip monitor all-nsid > > I thought the concern of the patch is the overhead of sending one > additional RTM_

Re: [**EXTERNAL**] Re: VRF with enslaved L3 enabled bridge

2018-09-07 Thread David Ahern
On 9/7/18 9:56 AM, D'Souza, Nelson wrote: > > *From:* David Ahern > *Sent:* Thursday, September 6, 2018 5:27 PM > *To:* D'Souza, Nelson; netdev@vger.kernel.org > *Subject:* Re: [**EXTERNAL**] Re: VRF w

Re: [**EXTERNAL**] Re: VRF with enslaved L3 enabled bridge

2018-09-06 Thread David Ahern
On 9/5/18 12:00 PM, D'Souza, Nelson wrote: > Just following up would you be able to confirm that this is a Linux VRF > issue? I can confirm that I can reproduce the problem. Need to find time to dig into it.

Re: [PATCH net] net/ipv6: fix incorrect fib6 gateway info after do redirect

2018-09-06 Thread David Ahern
On 9/6/18 6:57 AM, Hangbin Liu wrote: > When receive a redirect message and call rt6_do_redirect(), we allocate > a new rt6_info and set new flags and gateway info, but not update these > info to fib6_info. > > Then if a user try to get the route info via `ip route get`, he will still > get the

Re: BUG: unable to handle kernel paging request in fib6_node_lookup_1

2018-09-05 Thread David Ahern
On 9/5/18 12:11 AM, Song Liu wrote: > We are debugging an issue with fib6_node_lookup_1(). > > We use a 4.16 based kernel, and we have back ported most upstream > patches in ip6_fib.{c.h}. The only major differences I can spot are > Did you backport all patches in each set that included a

Re: [PATCH RFC net-next 00/18] net: Improve route scalability via support for nexthop objects

2018-09-04 Thread David Ahern
On 9/2/18 11:34 AM, David Miller wrote: > From: dsah...@kernel.org > Date: Fri, 31 Aug 2018 17:49:35 -0700 > >> Examples >> 1. Single path >> $ ip nexthop add id 1 via 10.99.1.2 dev veth1 >> $ ip route add 10.1.1.0/24 nhid 1 >> >> $ ip next ls >> id 1 via 10.99.1.2 src 10.99.1.1

Re: [PATCH iproute2-next] ip: Add support for nexthop objects

2018-09-04 Thread David Ahern
will eventually come from the kernel via header sync, so I have to stick to whatever style is appropriate for the uapi files. >> diff --git a/ip/ipnexthop.c b/ip/ipnexthop.c >> new file mode 100644 >> index ..9fa4b7292426 >> --- /dev/null >> +++ b/ip/ipn

Re: [PATCH RFC net-next 18/18] net/ipv4: Optimization for fib_info lookup

2018-09-04 Thread David Ahern
On 9/1/18 2:43 PM, Stephen Hemminger wrote: > On Fri, 31 Aug 2018 17:49:53 -0700 > dsah...@kernel.org wrote: > >> +static inline unsigned int fib_info_hashfn_cfg(const struct fib_config *cfg) >> +{ >> +unsigned int mask = (fib_info_hash_size - 1); >> +unsigned int val = 0; >> + >> +

Re: [PATCH net-next v1 3/5] ipv4: enable IFA_IF_NETNSID for RTM_GETADDR

2018-09-03 Thread David Ahern
On 9/2/18 10:37 PM, Christian Brauner wrote: > - Backwards Compatibility: > If userspace wants to determine whether ipv4 RTM_GETADDR requests support > the new IFA_IF_NETNSID property they should verify that the reply after > sending a request includes the IFA_IF_NETNSID property. If it does

Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace

2018-09-03 Thread David Ahern
On 9/3/18 3:10 AM, Thomas Haller wrote: > Hi, > > On Sat, 2018-09-01 at 17:45 -0600, David Ahern wrote: >> On 9/1/18 3:05 AM, Lorenzo Bianconi wrote: >>> >>> I was thinking about the commit 38e01b30563a and then I realized I >>> misread the code >>&

Re: [PATCH] net: ipv6: route: Fix a sleep-in-atomic-context bug in ip6_convert_metrics()

2018-09-03 Thread David Ahern
On 9/1/18 5:19 AM, Jia-Ju Bai wrote: > The kernel module may sleep with holding a spinlock. > > The function call paths (from bottom to top) in Linux-4.16 are: > > [FUNC] kzalloc(GFP_KERNEL) > net/ipv6/route.c, 2430: > kzalloc in ip6_convert_metrics > net/ipv6/route.c, 2890: >

Re: [PATCH] net: ipv6: route: Fix a sleep-in-atomic-context bug in ip6_convert_metrics()

2018-09-03 Thread David Ahern
On 9/1/18 5:19 AM, Jia-Ju Bai wrote: > The kernel module may sleep with holding a spinlock. > > The function call paths (from bottom to top) in Linux-4.16 are: > > [FUNC] kzalloc(GFP_KERNEL) > net/ipv6/route.c, 2430: > kzalloc in ip6_convert_metrics > net/ipv6/route.c, 2890: >

Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace

2018-09-01 Thread David Ahern
On 9/1/18 3:05 AM, Lorenzo Bianconi wrote: > > I was thinking about the commit 38e01b30563a and then I realized I > misread the code > yesterday. The commit 38e01b30563a provides all relevant info but it > emits the event > for veth1 (the device moved in the new namespace). > An userspace

Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace

2018-08-31 Thread David Ahern
On 8/31/18 10:19 AM, Lorenzo Bianconi wrote: >> On 8/31/18 5:43 AM, Lorenzo Bianconi wrote: >>> When moving a veth device to another namespace, userspace receives a >>> RTM_DELLINK message indicating the device has been removed from current >>> netns. However, the other peer does not receive a

Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace

2018-08-31 Thread David Ahern
On 8/31/18 5:43 AM, Lorenzo Bianconi wrote: > When moving a veth device to another namespace, userspace receives a > RTM_DELLINK message indicating the device has been removed from current > netns. However, the other peer does not receive a netlink event > containing new values for

Re: [PATCH net] net/ipv6: Only update MTU metric if it set

2018-08-30 Thread David Ahern
On 8/30/18 3:49 PM, Jan Janssen wrote: > You mentioned that systemd-networkd is doing something silly here, so I was > wondering if you could make a bug report to fix the underlying issue? I don't > mind doing it myself but you're the expert and can explain things better. It is silly in the

Re: [PATCH v2 iproute2-next 0/3] support delivering packets in

2018-08-30 Thread David Ahern
On 8/26/18 8:42 PM, Yousuk Seung wrote: > This series adds support for the new "slot" netem parameter for > slotting. Slotting is an approximation of shared media that gather up > packets within a varying delay window before delivering them nearly at > once. > > Dave Taht (2): > tc: support

Re: [PATCH net] ipv6: don't get lwtstate twice in ip6_rt_copy_init()

2018-08-30 Thread David Ahern
> rt->rt6i_src = ort->fib6_src; > #endif > rt->rt6i_prefsrc = ort->fib6_prefsrc; > - rt->dst.lwtstate = lwtstate_get(ort->fib6_nh.nh_lwtstate); > } > > static struct fib6_node* fib6_backtrack(struct fib6_node *fn, > Thanks for the patch. Reviewed-by: David Ahern

Re: [PATCH RFC net-next] net/fib: Poptrie based FIB lookup

2018-08-27 Thread David Ahern
On 8/27/18 10:24 AM, Stephen Hemminger wrote: > > Also, as Dave mentioned any implementation needs to handle multiple namespaces > and routing tables. > > Could this alternative lookup be enabled via sysctl at runtime rather than > kernel config? > I spent time a couple of years ago

Re: Regression: youtube-dl hanging on download

2018-08-25 Thread David Ahern
On 8/25/18 9:23 AM, Jan Janssen wrote: > Hi, > > youtube-dl hangs trying to download videos from youtube. The commit below is > my regression test result. Disabling ipv6 indeed does fix this for me. > Thanks for the report. Can you boot a pre-4.18 kernel and send me, offlist, the output of 'ip

Re: oops with ip6_rt_cache_alloc

2018-08-24 Thread David Ahern
On 8/24/18 4:26 PM, Yonghong Song wrote: > Hi, > > We got a kernel oops with the following stack trace: > > CPU: 24 PID: 0 Comm: swapper/24 Not tainted > 4.16.0-10_fbk1_1183_g7e4ee4c8171c #10 > "Hardware name: Quanta Leopard-DDR3/Leopard-DDR3, BIOS F06_3A16.DDR3 > 11/19/2015" > RIP:

Re: [PATCH] net/ipv6: init ip6 anycast rt->dst.input as ip6_input

2018-08-22 Thread David Ahern
Fixes: 6edb3c96a5f02 ("net/ipv6: Defer initialization of dst to data path") > Signed-off-by: Hangbin Liu > --- > net/ipv6/route.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Good catch. Reviewed-by: David Ahern

Re: [Patch net] addrconf: reduce unnecessary atomic allocations

2018-08-22 Thread David Ahern
On 8/22/18 1:58 PM, Cong Wang wrote: > All the 3 callers of addrconf_add_mroute() assert RTNL > lock, they don't take any additional lock either, so > it is safe to convert it to GFP_KERNEL. > > Same for sit_add_v4_addrs(). > > Cc: David Ahern > Signed-off-by: Cong

Re: Bug in FIB insert

2018-08-17 Thread David Ahern
On 8/16/18 6:59 PM, Md. Islam wrote: > There is a bug in fib_table_insert(). If I add following routes, > > 23.20.0.0/14     veth1 > 23.20.0.0/15     veth2 > > FIB lookup on 23.22.111.212  results veth1, not veth2. > veth1 is the correct lookup

Re: [iproute PATCH v5 1/2] Make colored output configurable

2018-08-17 Thread David Ahern
++-- > man/man8/ip.8 | 13 +++-- > man/man8/tc.8 | 13 +++-- > tc/tc.c | 3 +-- > 8 files changed, 77 insertions(+), 13 deletions(-) > LGTM. Reviewed-by: David Ahern

Re: [PATCH iproute2-next] iproute_lwtunnel: allow specifying 'src' for 'encap ip' / 'encap ip6'

2018-08-17 Thread David Ahern
On 8/17/18 1:31 AM, Shmulik Ladkani wrote: > This allows the user to specify the LWTUNNEL_IP_SRC/LWTUNNEL_IP6_SRC > when setting an lwtunnel encapsulation route. > > Signed-off-by: Shmulik Ladkani > --- > ip/iproute_lwtunnel.c | 22 -- > 1 file changed, 20 insertions(+), 2

Re: [iproute PATCH v4] Make colored output configurable

2018-08-16 Thread David Ahern
On 8/16/18 3:37 AM, Phil Sutter wrote: > Allow for -color={never,auto,always} to have colored output disabled, > enabled only if stdout is a terminal or enabled regardless of stdout > state. > > Signed-off-by: Phil Sutter > --- > Changes since v1: > - Allow to override isatty() check by

Re: [iproute PATCH v2 4/4] lib: Enable colored output only for TTYs

2018-08-15 Thread David Ahern
On 8/15/18 10:51 AM, Phil Sutter wrote: > Should I respin the fixes or will you apply the series > partially? Stephen has released 4.18 but not merged -next to master yet, so I applied the first 3 to -next.

Re: [iproute PATCH v2 4/4] lib: Enable colored output only for TTYs

2018-08-15 Thread David Ahern
On 8/15/18 10:39 AM, Phil Sutter wrote: > On Wed, Aug 15, 2018 at 10:24:31AM -0600, David Ahern wrote: >> On 8/15/18 10:21 AM, Phil Sutter wrote: >>> Add an additional prerequisite to check_enable_color() to make sure >>> stdout actually points to an open TTY d

<    3   4   5   6   7   8   9   10   11   12   >