Re: [PATCH net] ipv6: do not leave garbage in rt->fib6_metrics

2018-10-05 Thread David Ahern
t; + rt->fib6_metrics = (struct dst_metrics *)_default_metrics; > goto out; > } > > Reviewed-by: David Ahern Thanks, Eric.

Re: [PATCH net-next 20/20] net/bridge: Update br_mdb_dump for strict data checking

2018-10-05 Thread David Ahern
On 10/5/18 1:34 AM, David Miller wrote: > From: David Ahern > Date: Thu, 4 Oct 2018 14:33:55 -0700 > >> @@ -162,6 +162,28 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct >> netlink_callback *cb, >> return err; >> } >> >> +

Re: [PATCH net-next 0/5] net: Consolidate metrics handling for ipv4 and ipv6

2018-10-05 Thread David Ahern
On 10/5/18 7:08 AM, Eric Dumazet wrote: > Commit 767a2217533fed6 ("net: common metrics init helper for FIB entries") > is not correct because we need to better deal with error paths. > > I will submit this more formally when I can reach my workstation in a few > minutes : > > diff --git

[PATCH iproute2-next] libnetlink: Use NLMSG_LENGTH to set nlmsg_len

2018-10-04 Thread David Ahern
From: David Ahern Some of the inner headers are not 4-byte aligned, so use NLMSG_LENGTH instead of sizeof(req) to set nlmsg_len. Signed-off-by: David Ahern --- lib/libnetlink.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libnetlink.c b/lib

[PATCH net-next 00/20] rtnetlink: Add support for rigid checking of data in dump request

2018-10-04 Thread David Ahern
From: David Ahern There are many use cases where a user wants to influence what is returned in a dump for some rtnetlink command: one is wanting data for a different namespace than the one the request is received and another is limiting the amount of data returned in the dump to a specific set

[PATCH net-next 13/20] rtnetlink: Update fib dumps for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Add helper to check netlink message for route dumps. If the strict flag is set the dump request is expected to have an rtmsg struct as the header. All elements of the struct are expected to be 0 with the exception of rtm_flags (which is used by both ipv4 and ipv6 dumps

[PATCH net-next 16/20] net/namespace: Update rtnl_net_dumpid for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update rtnl_net_dumpid for strict data checking. If the flag is set, the dump request is expected to have an rtgenmsg struct as the header which has the family as the only element. No data may be appended. Signed-off-by: David Ahern --- net/core/net_namespace.c | 8

[PATCH net-next 06/20] net/ipv4: Update inet_dump_ifaddr for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update inet_dump_ifaddr for strict data checking. If the flag is set, the dump request is expected to have an ifaddrmsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute is taken as a request to influence

[PATCH net-next 15/20] net/neighbor: Update neightbl_dump_info for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update neightbl_dump_info for strict data checking. If the flag is set, the dump request is expected to have an ndtmsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off-by: David Ahern --- net/core/neighbour.c

[PATCH net-next 01/20] netlink: Pass extack to dump handlers

2018-10-04 Thread David Ahern
From: David Ahern Declare extack in netlink_dump and pass to dump handlers via netlink_callback. Add any extack message after the dump_done_errno allowing error messages to be returned. This will be useful when strict checking is done on dump requests, returning why the dump fails EINVAL

[PATCH net-next 03/20] net: Add extack to nlmsg_parse

2018-10-04 Thread David Ahern
From: David Ahern Make sure extack is passed to nlmsg_parse where easy to do so. Most of these are dump handlers and leveraging the extack in the netlink_callback. Signed-off-by: David Ahern --- net/core/devlink.c | 2 +- net/core/neighbour.c | 3 ++- net/core

[PATCH net-next 18/20] net/ipv6: Update ip6addrlbl_dump for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update ip6addrlbl_dump for strict data checking. If the flag is set, the dump request is expected to have an ifaddrlblmsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off-by: David Ahern --- net/ipv6

[PATCH net-next 05/20] netlink: Add new socket option to enable strict checking on dumps

2018-10-04 Thread David Ahern
From: David Ahern Add a new socket option, NETLINK_DUMP_STRICT_CHK, that userspace can use via setsockopt to request strict checking of headers and attributes on dump requests. To get dump features such as kernel side filtering based on data in the header or attributes appended to the dump

[PATCH net-next 19/20] net: Update netconf dump handlers for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update inet_netconf_dump_devconf, inet6_netconf_dump_devconf, and mpls_netconf_dump_devconf for strict data checking. If the flag is set, the dump request is expected to have an netconfmsg struct as the header. The struct only has the family member and no attributes can

[PATCH net-next 09/20] rtnetlink: Update rtnl_bridge_getlink for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update rtnl_bridge_getlink for strict data checking. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute is taken as a request to influence

[PATCH net-next 12/20] rtnetlink: Update ipmr_rtm_dumplink for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update ipmr_rtm_dumplink for strict data checking. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off-by: David Ahern --- net/ipv4/ipmr.c

[PATCH net-next 04/20] net/ipv6: Refactor address dump to push inet6_fill_args to in6_dump_addrs

2018-10-04 Thread David Ahern
From: David Ahern Pull the inet6_fill_args arg up to in6_dump_addrs and move netnsid into it. Signed-off-by: David Ahern Acked-by: Christian Brauner --- net/ipv6/addrconf.c | 57 - 1 file changed, 30 insertions(+), 27 deletions(-) diff

[PATCH net-next 07/20] net/ipv6: Update inet6_dump_addr for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update inet6_dump_addr for strict data checking. If the flag is set, the dump request is expected to have an ifaddrmsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute is taken as a request to influence

[PATCH net-next 11/20] rtnetlink: Update inet6_dump_ifinfo for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update inet6_dump_ifinfo for strict data checking. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off-by: David Ahern --- net/ipv6

[PATCH net-next 10/20] rtnetlink: Update rtnl_stats_dump for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update rtnl_stats_dump for strict data checking. If the flag is set, the dump request is expected to have an if_stats_msg struct as the header. All elements of the struct are expected to be 0 except filter_mask which must be non-0 (legacy behavior). No attributes are supported

[PATCH net-next 17/20] net/fib_rules: Update fib_nl_dumprule for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update fib_nl_dumprule for strict data checking. If the flag is set, the dump request is expected to have fib_rule_hdr struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off-by: David Ahern --- net/core/fib_rules.c

[PATCH net-next 14/20] net/neighbor: Update neigh_dump_info for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update neigh_dump_info for strict data checking. If the flag is set, the dump request is expected to have an ndmsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute is taken as a request to influence the data

[PATCH net-next 08/20] rtnetlink: Update rtnl_dump_ifinfo for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update rtnl_dump_ifinfo for strict data checking. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute is taken as a request to influence

[PATCH net-next 20/20] net/bridge: Update br_mdb_dump for strict data checking

2018-10-04 Thread David Ahern
From: David Ahern Update br_mdb_dump for strict data checking. If the flag is set, the dump request is expected to have a br_port_msg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off-by: David Ahern --- net/bridge/br_mdb.c

[PATCH net-next 02/20] netlink: Add extack message to nlmsg_parse for invalid header length

2018-10-04 Thread David Ahern
From: David Ahern Give a user a reason why EINVAL is returned in nlmsg_parse. Signed-off-by: David Ahern --- include/net/netlink.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/netlink.h b/include/net/netlink.h index 589683091f16..9522a0bf1f3a 100644

Re: [PATCH v2 net-next] rtnetlink: fix rtnl_fdb_dump() for ndmsg header

2018-10-04 Thread David Ahern
2 ("net: rtnetlink: bail out from rtnl_fdb_dump() on parse > error") > Fixes: 5e6d24358799 ("bridge: netlink dump interface at par with brctl") > Reported-by: Aidan Obley > Signed-off-by: Mauricio Faria de Oliveira > > --- > v2: Change logic to check msg siz

[PATCH net-next] net/neigh: Extend dump filter to proxy neighbor dumps

2018-10-03 Thread David Ahern
From: David Ahern Move the attribute parsing from neigh_dump_table to neigh_dump_info, and pass the filter arguments down to neigh_dump_table in a new struct. Add the filter option to proxy neigh dumps as well to make them consistent. Signed-off-by: David Ahern --- net/core/neighbour.c | 72

[PATCH net] net: sched: Add policy validation for tc attributes

2018-10-03 Thread David Ahern
From: David Ahern A number of TC attributes are processed without proper validation (e.g., length checks). Add a tca policy for all input attributes and use when invoking nlmsg_parse. The 2 Fixes tags below cover the latest additions. The other attributes are a string (KIND), nested attribute

Re: [PATCH iproute2 net-next v1 5/6] tc: Add support for configuring the taprio scheduler

2018-10-03 Thread David Ahern
On 9/28/18 7:10 PM, Vinicius Costa Gomes wrote: > This traffic scheduler allows traffic classes states (transmission > allowed/not allowed, in the simplest case) to be scheduled, according > to a pre-generated time sequence. This is the basis of the IEEE > 802.1Qbv specification. > > Example

Re: [PATCH RFC v2 net-next 00/25] rtnetlink: Add support for rigid checking of data in dump request

2018-10-03 Thread David Ahern
On 10/3/18 8:59 AM, Stephen Hemminger wrote: > On Mon, 1 Oct 2018 17:28:26 -0700 > David Ahern wrote: > >> How to resolve the problem of not breaking old userspace yet be able to >> move forward with new features such as kernel side filtering which are >> crucial for

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

2018-10-02 Thread David Ahern
On 10/2/18 1:27 AM, Eelco Chaudron wrote: > Add support for showing hardware specific counters to easy > troubleshooting hardware offload. > > $ tc -s filter show dev enp3s0np0 parent : > filter protocol ip pref 1 flower chain 0 > filter protocol ip pref 1 flower chain 0 handle 0x1 >

Re: [PATCH iproute2-next] tc: f_flower: add geneve option match support to flower

2018-10-02 Thread David Ahern
On 9/28/18 8:03 AM, Simon Horman wrote: > From: Pieter Jansen van Vuuren > > Allow matching on options in Geneve tunnel headers. > > The options can be described in the form > CLASS:TYPE:DATA/CLASS_MASK:TYPE_MASK:DATA_MASK, where CLASS is > represented as a 16bit hexadecimal value, TYPE as an

Re: [PATCH net-next v2 00/10] vrf: allow simultaneous service instances in default and other VRFs

2018-10-02 Thread David Ahern
On 10/1/18 2:43 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 net-next v2 06/10] net: IP[V6]_MULTICAST_IF constraint on unbound socket if VRFs present

2018-10-02 Thread David Ahern
On 10/1/18 2:43 AM, Mike Manning wrote: > From: Duncan Eastoe > > If setsockopt(IP_MULTICAST_IF) or setsockopt(IPV6_MULTICAST_IF) is > called on a socket which is not bound to a VRF then we should ensure > that the output device chosen is also not bound to a VRF master. Why does it matter? An

Re: [PATCH net-next v2 01/10] net: allow binding socket in a VRF when there's an unbound socket

2018-10-02 Thread David Ahern
On 10/1/18 2:43 AM, Mike Manning wrote: > 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 security risk. please drop

Re: [PATCH net-next v2 04/10] net: provide a sysctl raw_l3mdev_accept for raw socket lookup with VRFs

2018-10-02 Thread David Ahern
On 10/1/18 2:43 AM, Mike Manning wrote: > Add a sysctl raw_l3mdev_accept to control raw socket lookup in a manner > similar to use of tcp_l3mdev_accept for stream and of udp_l3mdev_accept > for datagram sockets. Have this default to off as this is what users > expect, given that there is no

Re: [PATCH RFC v2 net-next 03/25] netlink: introduce NLM_F_DUMP_PROPER_HDR flag

2018-10-02 Thread David Ahern
On 10/2/18 10:30 AM, Jiri Benc wrote: > On Tue, 2 Oct 2018 08:57:24 -0600, David Ahern wrote: >> You can when you introduce a new option or a new flag that is required >> to get new behavior like kernel side filtering. > > Yes. That was what I tried with the patchset a few

Re: [PATCH RFC v2 net-next 02/25] net/ipv6: Refactor address dump to push inet6_fill_args to in6_dump_addrs

2018-10-02 Thread David Ahern
On 10/2/18 4:54 AM, Jiri Benc wrote: > On Mon, 1 Oct 2018 17:28:28 -0700, David Ahern wrote: >> Pull the inet6_fill_args arg up to in6_dump_addrs and move netnsid >> into it. Since IFA_TARGET_NETNSID is a kernel side filter add the >> NLM_F_DUMP_FILTERED flag so usersp

Re: [PATCH RFC v2 net-next 03/25] netlink: introduce NLM_F_DUMP_PROPER_HDR flag

2018-10-02 Thread David Ahern
On 10/2/18 5:27 AM, Jiri Benc wrote: > On Tue, 2 Oct 2018 13:18:32 +0200, Christian Brauner wrote: >> I didn't find this in the linked thread. > > Maybe it was suggested in another thread or in person on a conference, > I can't remember, it's too long ago, sorry. > >> What I find interesting and

Re: [PATCH RFC v2 net-next 03/25] netlink: introduce NLM_F_DUMP_PROPER_HDR flag

2018-10-02 Thread David Ahern
On 10/2/18 5:06 AM, Jiri Benc wrote: > On Mon, 1 Oct 2018 17:28:29 -0700, David Ahern wrote: >> Add a new flag, NLM_F_DUMP_PROPER_HDR, for userspace to indicate to the >> kernel that it believes it is sending the right header struct for the >> dump message type (ifinfo

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

2018-10-02 Thread David Ahern
On 10/2/18 4:04 AM, Jiri Benc wrote: > On Fri, 28 Sep 2018 12:28:41 -0700, David Ahern wrote: >> --- a/net/core/rtnetlink.c >> +++ b/net/core/rtnetlink.c >> @@ -1898,10 +1898,8 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, >> struct netlink_callback

Re: [PATCH iproute2 net-next] ipneigh: update man page and help for router

2018-10-01 Thread David Ahern
On 9/29/18 8:48 PM, Roopa Prabhu wrote: > From: Roopa Prabhu > > While at it also add missing text for proxy in the man page. > > Signed-off-by: Roopa Prabhu > --- > ip/ipneigh.c| 1 + > man/man8/ip-neighbour.8 | 11 ++- > 2 files changed, 11 insertions(+), 1 deletion(-)

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

2018-10-01 Thread David Ahern
> > Signed-off-by: Patrick Ruddy > Signed-off-by: Mike Manning > --- > drivers/net/vrf.c | 11 +++ > net/ipv6/ip6mr.c | 48 > 2 files changed, 47 insertions(+), 12 deletions(-) > Reviewed-by: David Ahern

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

2018-10-01 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

[PATCH RFC v2 net-next 00/25] rtnetlink: Add support for rigid checking of data in dump request

2018-10-01 Thread David Ahern
From: David Ahern There are many use cases where a user wants to influence what is returned in a dump for some rtnetlink command: one is wanting data for a different namespace than the one the request is received and another is limiting the amount of data returned in the dump to a specific set

[PATCH RFC v2 net-next 19/25] net/bridge: Update br_mdb_dump to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update br_mdb_dump to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have a br_port_msg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off

[PATCH RFC v2 net-next 17/25] net/ipv6: Update ip6addrlbl_dump to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update ip6addrlbl_dump to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ifaddrlblmsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off

[PATCH RFC v2 net-next 07/25] rtnetlink: Update rtnl_bridge_getlink to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update rtnl_bridge_getlink to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header potentially followed by one or more attributes. Any data passed in the header

[PATCH RFC v2 net-next 09/25] rtnetlink: Update inet6_dump_ifinfo to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update inet6_dump_ifinfo to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off

[PATCH RFC v2 net-next 13/25] net/neighbor: Update neigh_dump_info to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update neigh_dump_info to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ndmsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute

[PATCH RFC v2 net-next 03/25] netlink: introduce NLM_F_DUMP_PROPER_HDR flag

2018-10-01 Thread David Ahern
From: David Ahern Add a new flag, NLM_F_DUMP_PROPER_HDR, for userspace to indicate to the kernel that it believes it is sending the right header struct for the dump message type (ifinfomsg, ifaddrmsg, rtmsg, fib_rule_hdr, ...). Setting the flag in the netlink message header indicates

[PATCH RFC v2 net-next 02/25] net/ipv6: Refactor address dump to push inet6_fill_args to in6_dump_addrs

2018-10-01 Thread David Ahern
From: David Ahern Pull the inet6_fill_args arg up to in6_dump_addrs and move netnsid into it. Since IFA_TARGET_NETNSID is a kernel side filter add the NLM_F_DUMP_FILTERED flag so userspace knows the request was honored. Signed-off-by: David Ahern Acked-by: Christian Brauner --- net/ipv6

[PATCH RFC v2 net-next 14/25] net/neighbor: Update neightbl_dump_info to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update neightbl_dump_info to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ndtmsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off

[PATCH RFC v2 net-next 08/25] rtnetlink: Update rtnl_stats_dump to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update rtnl_stats_dump to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an if_stats_msg struct as the header. All elements of the struct are expected to be 0 except filter_mask which must be non-0 (legacy

[PATCH RFC v2 net-next 05/25] net/ipv6: Update inet6_dump_addr to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update inet6_dump_addr to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ifaddrmsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute

[PATCH RFC v2 net-next 04/25] net/ipv4: Update inet_dump_ifaddr to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update inet_dump_ifaddr to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ifaddrmsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute

[PATCH RFC v2 net-next 21/25] net/ipv4: Plumb support for filtering route dumps

2018-10-01 Thread David Ahern
From: David Ahern Implement kernel side filtering of routes by table id, egress device index, protocol, tos, scope, and route type. Signed-off-by: David Ahern --- include/net/ip_fib.h| 2 +- net/ipv4/fib_frontend.c | 13 - net/ipv4/fib_trie.c | 33

[PATCH RFC v2 net-next 01/25] net/netlink: Pass extack to dump callbacks

2018-10-01 Thread David Ahern
From: David Ahern Pass extack to dump callbacks by adding extack to netlink_dump_control, transferring to netlink_callback and adding to the netlink_dump. Update rtnetlink as the first user. Update netlink_dump to add any message after the dump_done_errno. Signed-off-by: David Ahern

[PATCH RFC v2 net-next 18/25] net: Update netconf dump handlers to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update inet_netconf_dump_devconf, inet6_netconf_dump_devconf, and mpls_netconf_dump_devconf to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an netconfmsg struct as the header. The struct only has

[PATCH RFC v2 net-next 20/25] net: Add struct for fib dump filter

2018-10-01 Thread David Ahern
From: David Ahern Add struct fib_dump_filter for options on limiting which routes are dumped. The current list is table id, tos, protocol, scope, route type, flags and nexthop device index. This patch adds the struct and argument to ip_valid_fib_dump_req so that per-protocol patches can be done

[PATCH RFC v2 net-next 25/25] net: Enable kernel side filtering of route dumps

2018-10-01 Thread David Ahern
From: David Ahern Update parsing of route dump request to enable kernel side of filtering. Signed-off-by: David Ahern --- net/ipv4/fib_frontend.c | 42 ++ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4

[PATCH RFC v2 net-next 11/25] rtnetlink: Update fib dumps to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Add helper to check netlink message for route dumps. The dump request is expected to have an rtmsg struct as the header. All elements of the struct are expected to be 0 with the exception of rtm_flags (which is used by both ipv4 and ipv6 dumps) and with no attributes can

[PATCH RFC v2 net-next 12/25] net/neigh: Refactor dump filter handling

2018-10-01 Thread David Ahern
From: David Ahern Move the attribute parsing from neigh_dump_table to neigh_dump_info, and pass the filter arguments down to neigh_dump_table in a new struct. Add the filter option to proxy neigh dumps as well to make the dumps consistent. Signed-off-by: David Ahern --- net/core/neighbour.c

[PATCH RFC v2 net-next 15/25] net/namespace: Update rtnl_net_dumpid to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update rtnl_net_dumpid to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. The dump request is expected to have an rtgenmsg struct which has the family as the only element. No data may be appended. Signed-off-by: David Ahern --- net/core/net_namespace.c | 8

[PATCH RFC v2 net-next 16/25] net/fib_rules: Update fib_nl_dumprule to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update fib_nl_dumprule to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have fib_rule_hdr struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off

[PATCH RFC v2 net-next 10/25] rtnetlink: Update ipmr_rtm_dumplink to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update ipmr_rtm_dumplink to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header. All elements of the struct are expected to be 0 and no attributes can be appended. Signed-off

[PATCH RFC v2 net-next 22/25] net/ipv6: Plumb support for filtering route dumps

2018-10-01 Thread David Ahern
From: David Ahern Implement kernel side filtering of routes by table id, egress device index, protocol, and route type. Move the existing route flags check for prefix only routes to the new filter. Signed-off-by: David Ahern --- net/ipv6/ip6_fib.c | 13 + net/ipv6/route.c | 36

[PATCH RFC v2 net-next 24/25] net: Plumb support for filtering ipv4 and ipv6 multicast route dumps

2018-10-01 Thread David Ahern
From: David Ahern Implement kernel side filtering of routes by egress device index and table id. Signed-off-by: David Ahern --- include/linux/mroute_base.h | 5 +++-- net/ipv4/ipmr.c | 2 +- net/ipv4/ipmr_base.c| 42 +- net/ipv6

[PATCH RFC v2 net-next 06/25] rtnetlink: Update rtnl_dump_ifinfo to support NLM_F_DUMP_PROPER_HDR

2018-10-01 Thread David Ahern
From: David Ahern Update rtnl_dump_ifinfo to check for NLM_F_DUMP_PROPER_HDR in the netlink message header. If the flag is set, the dump request is expected to have an ifinfomsg struct as the header potentially followed by one or more attributes. Any data passed in the header or as an attribute

[PATCH RFC v2 net-next 23/25] net/mpls: Plumb support for filtering route dumps

2018-10-01 Thread David Ahern
From: David Ahern Implement kernel side filtering of routes by egress device index and protocol. MPLS uses only a single table and route type. Signed-off-by: David Ahern --- net/mpls/af_mpls.c | 55 +- 1 file changed, 54 insertions(+), 1

Re: [PATCH v2 8/9] net: rtm_to_fib6_config() - 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 | 23 --- > 1 file changed, 12 insertions(+), 11 deletions(-

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

2018-10-01 Thread David Ahern
eletions(-) > Reviewed-by: David Ahern

Re: [PATCH v2 9/9] net: inet6_rtm_getroute() - 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 > > Signed-off-by: Maciej Żenczykowski > --- > net/ipv6/route.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > Reviewed-by: David Ahern

Re: [PATCH v2 2/9] net: inet_rtm_getroute() - 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 > > Signed-off-by: Maciej Żenczykowski > --- > net/ipv4/route.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > Reviewed-by: David Ahern

Re: [PATCH v2 6/9] net: ip6_update_pmtu() - 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 5/9] net: remove 1 always zero parameter from ip6_redirect_no_header()

2018-10-01 Thread David Ahern
+--- > 3 files changed, 3 insertions(+), 6 deletions(-) > Reviewed-by: David Ahern

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:

<    1   2   3   4   5   6   7   8   9   10   >