[patch v1, kernel 3.2.1] RTNETLINK adjusting values ofmin_ifinfo_dump_size

From: Stefan Gula
Date: Wed Jan 25 2012 - 03:46:41 EST


From: Stefan Gula <steweg@xxxxxxxxx>

This patch extends the rtnetlink.c. The problem is that calcit, which
returns the value min_ifinfo_dump_size, is called without ability to
get device info as well (struct net_device *dev is not accessible from
it). This create a problem if required size of struct sk_buff *skb is
not enough big to comply with all data returned by fill_info function
for the interface that required size can vary over time, e.g. some
dynamic structures will be putted to skb like hlists or lists. To do
this patch extends the do_setlink function with recalculating of
min_ifinfo_dump_size accordingly to device type and get_size
functions.

Signed-off-by: Stefan Gula <steweg@xxxxxxxxx>

---

code needed to be ok before I can resubmit my macvlan source mode patch

--- linux-3.2.1-orig/net/core/rtnetlink.c 2012-01-12 20:42:45.000000000 +0100
+++ linux/net/core/rtnetlink.c 2012-01-24 14:26:58.083219352 +0100
@@ -1506,6 +1506,9 @@ errout:

if (send_addr_notify)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
+ min_ifinfo_dump_size = max_t(u16, if_nlmsg_size(dev),
+ min_ifinfo_dump_size);
+
return err;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/