kernel-hacking-2024-linux-s.../net/core
Greg Rose 115c9b8192 rtnetlink: Fix problem with buffer allocation
Implement a new netlink attribute type IFLA_EXT_MASK.  The mask
is a 32 bit value that can be used to indicate to the kernel that
certain extended ifinfo values are requested by the user application.
At this time the only mask value defined is RTEXT_FILTER_VF to
indicate that the user wants the ifinfo dump to send information
about the VFs belonging to the interface.

This patch fixes a bug in which certain applications do not have
large enough buffers to accommodate the extra information returned
by the kernel with large numbers of SR-IOV virtual functions.
Those applications will not send the new netlink attribute with
the interface info dump request netlink messages so they will
not get unexpectedly large request buffers returned by the kernel.

Modifies the rtnl_calcit function to traverse the list of net
devices and compute the minimum buffer size that can hold the
info dumps of all matching devices based upon the filter passed
in via the new netlink attribute filter mask.  If no filter
mask is sent then the buffer allocation defaults to NLMSG_GOODSIZE.

With this change it is possible to add yet to be defined netlink
attributes to the dump request which should make it fairly extensible
in the future.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-21 16:56:45 -05:00
..
datagram.c
dev.c gro: more generic L2 header check 2012-02-08 18:26:54 -05:00
dev_addr_lists.c net: introduce netif_addr_lock_nested() and call if when appropriate 2012-01-09 12:46:58 -08:00
drop_monitor.c
dst.c
ethtool.c ethtool: Null-terminate filename passed to ethtool_ops::flash_device 2012-02-01 14:47:17 -05:00
fib_rules.c
filter.c
flow.c
flow_dissector.c net: flow_dissector.c missing include linux/export.h 2012-01-24 16:03:33 -05:00
gen_estimator.c
gen_stats.c
iovec.c
kmap_skb.h
link_watch.c
Makefile
neighbour.c neighbour: Fixed race condition at tbl->nht 2012-02-21 16:28:10 -05:00
net-sysfs.c bql: Fix inconsistency between file mode and attr method. 2012-01-17 10:05:55 -05:00
net-sysfs.h
net-traces.c
net_namespace.c netns: fix net_alloc_generic() 2012-01-26 13:36:19 -05:00
netevent.c
netpoll.c netpoll: netpoll_poll_dev() should access dev->flags 2012-02-14 15:24:26 -05:00
netprio_cgroup.c netprio_cgroup: don't allocate prio table when a device is registered 2012-02-10 15:08:57 -05:00
pktgen.c pktgen: Fix unsigned function that is returning negative vals 2012-01-22 15:08:44 -05:00
request_sock.c
rtnetlink.c rtnetlink: Fix problem with buffer allocation 2012-02-21 16:56:45 -05:00
scm.c
secure_seq.c net: fix some sparse errors 2012-01-17 10:31:12 -05:00
skbuff.c
sock.c netprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m 2012-02-10 15:08:57 -05:00
sock_diag.c
stream.c
sysctl_net_core.c
timestamping.c
user_dma.c
utils.c