mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Acked-by: Sridhar Samudrala <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6ac311ae8b
commit
b1974ed05e
5 changed files with 11 additions and 28 deletions
|
|
@ -1644,7 +1644,8 @@ errout:
|
|||
rtnl_set_sk_err(net, RTNLGRP_IPV4_IFADDR, err);
|
||||
}
|
||||
|
||||
static size_t inet_get_link_af_size(const struct net_device *dev)
|
||||
static size_t inet_get_link_af_size(const struct net_device *dev,
|
||||
u32 ext_filter_mask)
|
||||
{
|
||||
struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr);
|
||||
|
||||
|
|
@ -2398,4 +2399,3 @@ void __init devinet_init(void)
|
|||
rtnl_register(PF_INET, RTM_GETNETCONF, inet_netconf_get_devconf,
|
||||
inet_netconf_dump_devconf, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue