diff options
author | Arad, Ronen <ronen.arad@intel.com> | 2015-10-19 12:23:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-21 22:15:20 -0400 |
commit | b1974ed05ea90264d534a200e8a13932ad55f8b8 (patch) | |
tree | 854bca789c6a4e38dadbb9e5373742b970830fe7 /net/ipv4/devinet.c | |
parent | 6ac311ae8bfb47de09f349e781e26373944d2ee3 (diff) |
netlink: Rightsize IFLA_AF_SPEC size calculation
if_nlmsg_size() overestimates the minimum allocation size of netlink
dump request (when called from rtnl_calcit()) or the size of the
message (when called from rtnl_getlink()). This is because
ext_filter_mask is not supported by rtnl_link_get_af_size() and
rtnl_link_get_size().
The over-estimation is significant when at least one netdev has many
VLANs configured (8 bytes for each configured VLAN).
This patch-set "rightsizes" the protocol specific attribute size
calculation by propagating ext_filter_mask to rtnl_link_get_af_size()
and adding this a argument to get_link_af_size op in rtnl_af_ops.
Bridge module already used filtering aware sizing for notifications.
br_get_link_af_size_filtered() is consistent with the modified
get_link_af_size op so it replaces br_get_link_af_size() in br_af_ops.
br_get_link_af_size() becomes unused and thus removed.
Signed-off-by: Ronen Arad <ronen.arad@intel.com>
Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 735008472844..cebd9d31e65a 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1644,7 +1644,8 @@ errout: | |||
1644 | rtnl_set_sk_err(net, RTNLGRP_IPV4_IFADDR, err); | 1644 | rtnl_set_sk_err(net, RTNLGRP_IPV4_IFADDR, err); |
1645 | } | 1645 | } |
1646 | 1646 | ||
1647 | static size_t inet_get_link_af_size(const struct net_device *dev) | 1647 | static size_t inet_get_link_af_size(const struct net_device *dev, |
1648 | u32 ext_filter_mask) | ||
1648 | { | 1649 | { |
1649 | struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr); | 1650 | struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr); |
1650 | 1651 | ||
@@ -2398,4 +2399,3 @@ void __init devinet_init(void) | |||
2398 | rtnl_register(PF_INET, RTM_GETNETCONF, inet_netconf_get_devconf, | 2399 | rtnl_register(PF_INET, RTM_GETNETCONF, inet_netconf_get_devconf, |
2399 | inet_netconf_dump_devconf, NULL); | 2400 | inet_netconf_dump_devconf, NULL); |
2400 | } | 2401 | } |
2401 | |||