linux/net/core
Michal Kubecek ae0be8de9a netlink: make nla_nest_start() add NLA_F_NESTED flag
Even if the NLA_F_NESTED flag was introduced more than 11 years ago, most
netlink based interfaces (including recently added ones) are still not
setting it in kernel generated messages. Without the flag, message parsers
not aware of attribute semantics (e.g. wireshark dissector or libmnl's
mnl_nlmsg_fprintf()) cannot recognize nested attributes and won't display
the structure of their contents.

Unfortunately we cannot just add the flag everywhere as there may be
userspace applications which check nlattr::nla_type directly rather than
through a helper masking out the flags. Therefore the patch renames
nla_nest_start() to nla_nest_start_noflag() and introduces nla_nest_start()
as a wrapper adding NLA_F_NESTED. The calls which add NLA_F_NESTED manually
are rewritten to use nla_nest_start().

Except for changes in include/net/netlink.h, the patch was generated using
this semantic patch:

@@ expression E1, E2; @@
-nla_nest_start(E1, E2)
+nla_nest_start_noflag(E1, E2)

@@ expression E1, E2; @@
-nla_nest_start_noflag(E1, E2 | NLA_F_NESTED)
+nla_nest_start(E1, E2)

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-27 17:03:44 -04:00
..
Makefile flow_offload: add flow_rule and flow_match structures and use them 2019-02-06 10:38:25 -08:00
datagram.c datagram: remove rendundant 'peeked' argument 2019-04-08 09:51:54 -07:00
datagram.h net/core: Allow the compiler to verify declaration and definition consistency 2019-03-27 13:49:44 -07:00
dev.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
dev_addr_lists.c net: dev: Issue NETDEV_PRE_CHANGEADDR 2018-12-13 18:41:38 -08:00
dev_ioctl.c net/core: Document all dev_ioctl() arguments 2019-03-27 13:49:43 -07:00
devlink.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
drop_monitor.c
dst.c net: dst: remove gc leftovers 2019-03-21 13:39:25 -07:00
dst_cache.c
ethtool.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-05 14:14:19 -07:00
failover.c failover: allow name change on IFF_UP slave interfaces 2019-04-10 22:12:26 -07:00
fib_notifier.c
fib_rules.c
filter.c ipv6: Initialize fib6_result in bpf_ipv6_fib_lookup 2019-04-26 11:32:00 -04:00
flow_dissector.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-05 14:14:19 -07:00
flow_offload.c flow_offload: add flow action infrastructure 2019-02-06 10:38:25 -08:00
gen_estimator.c
gen_stats.c Revert: "net: sched: put back q.qlen into a single location" 2019-04-10 12:20:46 -07:00
gro_cells.c gro_cells: make sure device is up in gro_cells_receive() 2019-03-10 11:07:14 -07:00
hwbm.c
link_watch.c
lwt_bpf.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
lwtunnel.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
neighbour.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
net-procfs.c
net-sysfs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
net-sysfs.h
net-traces.c trace: events: add a few neigh tracepoints 2019-02-17 10:33:39 -08:00
net_namespace.c netns: read NETNSA_NSID as s32 attribute in rtnl_net_getid() 2019-04-11 11:26:27 -07:00
netclassid_cgroup.c
netevent.c
netpoll.c net: dev: rename queue selection helpers. 2019-03-20 11:18:54 -07:00
netprio_cgroup.c cgroup: net: remove left over MODULE_LICENSE tag 2019-04-22 21:50:54 -07:00
page_pool.c page_pool: use DMA_ATTR_SKIP_CPU_SYNC for DMA mappings 2019-02-13 22:00:16 -08:00
pktgen.c mm: replace all open encodings for NUMA_NO_NODE 2019-03-05 21:07:14 -08:00
ptp_classifier.c net/core: work around section mismatch warning for ptp_classifier 2019-04-16 20:46:17 -07:00
request_sock.c
rtnetlink.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
scm.c socket: Add SO_TIMESTAMPING_NEW 2019-02-03 11:17:31 -08:00
secure_seq.c
skbuff.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-04-22 21:35:55 -07:00
skmsg.c bpf: Stop the psock parser before canceling its work 2019-03-07 15:16:20 +01:00
sock.c net: fix sparc64 compilation of sock_gettstamp 2019-04-23 18:35:17 -07:00
sock_diag.c
sock_map.c
sock_reuseport.c net/core: Document reuseport_add_sock() bind_inany argument 2019-03-27 13:49:43 -07:00
stream.c tcp: reduce POLLOUT events caused by TCP_NOTSENT_LOWAT 2018-12-04 21:21:18 -08:00
sysctl_net_core.c net: convert rps_needed and rfs_needed to new static branch api 2019-03-23 21:57:38 -04:00
timestamping.c
tso.c
utils.c
xdp.c