RTNETLINK adjusting values of min_ifinfo_dump_size
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 RTNETLINK adjusting values of min_ifinfo_dump_size
From: Stefan Gula <[email protected]>
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.
---
code needed to be ok before I can resubmit my macvlan source mode patch
net/core/rtnetlink.c +3 -0
@@ -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; }
David Miller
maintainerFrom: Stefan Gula <[email protected]>
Date: Wed, 25 Jan 2012 09:43:15 +0100 (CET)
Quoted 13 lines
From: Stefan Gula <[email protected]>
This patch extends the
rtnetlink.c. The problem is that calcit, which returns the valuemin_ifinfo_dump_size, is called without ability to get device info as well (structnet_device*dev is not accessible from it). This create a problem if required size of structsk_buff*skb is not enough big to comply with all data returned byfill_infofunction 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 thedo_setlinkfunction with recalculating ofmin_ifinfo_dump_sizeaccordingly to device type andget_sizefunctions.
Quoted 1 line
Signed-off-by Stefan Gula <[email protected]>
This commit message is terrible, and the reason I know it's terrible is because even after reading it I still had to go read the code in order to understand what your change even does or why it's even necessary.
How about this:
Setting link parameters on a netdevice changes the value of if_nlmsg_size(), therefore it is necessary to recalculate min_ifinfo_dump_size.
2012/1/26 David Miller <[email protected]>:
Quoted 10 lines
From: Stefan Gula <[email protected]>
Date: Wed, 25 Jan 2012 09:43:15 +0100 (CET)Quoted 7 lines
From: Stefan Gula <[email protected]>
This patch extends the
rtnetlink.c. The problem is that calcit, which returns the valuemin_ifinfo_dump_size, is called without ability to get device info as well (structnet_device*dev is not accessible from it). This create a problem if required size of structsk_buff*skb is not enough big to comply with all data returned byfill_infofunction
0>> for the interface that required size can vary over time, e.g. some
Quoted 12 lines
Quoted 6 lines
dynamic structures will be putted to skb like hlists or lists. To do this patch extends the
do_setlinkfunction with recalculating ofmin_ifinfo_dump_sizeaccordingly to device type andget_sizefunctions.Signed-off-by Stefan Gula <[email protected]>This commit message is terrible, and the reason I know it's terrible is because even after reading it I still had to go read the code in order to understand what your change even does or why it's even necessary.
Quoted 6 lines
How about this:
Setting link parameters on a netdevice changes the value of
if_nlmsg_size(), therefore it is necessary to recalculatemin_ifinfo_dump_size.
Sound good... do I have to resubmit the patch with the correct description?
David Miller
maintainerFrom: Štefan Gula <[email protected]>
Date: Thu, 26 Jan 2012 12:01:44 +0100
Quoted 24 lines
2012/1/26 David Miller <[email protected]>:
Quoted 10 lines
From: Stefan Gula <[email protected]>
Date: Wed, 25 Jan 2012 09:43:15 +0100 (CET)Quoted 7 lines
From: Stefan Gula <[email protected]>
This patch extends the
rtnetlink.c. The problem is that calcit, which returns the valuemin_ifinfo_dump_size, is called without ability to get device info as well (structnet_device*dev is not accessible from it). This create a problem if required size of structsk_buff*skb is not enough big to comply with all data returned byfill_infofunction0>> for the interface that required size can vary over time, e.g. some
Quoted 12 lines
Quoted 6 lines
dynamic structures will be putted to skb like hlists or lists. To do this patch extends the
do_setlinkfunction with recalculating ofmin_ifinfo_dump_sizeaccordingly to device type andget_sizefunctions.Signed-off-by Stefan Gula <[email protected]>This commit message is terrible, and the reason I know it's terrible is because even after reading it I still had to go read the code in order to understand what your change even does or why it's even necessary.
Quoted 7 lines
Quoted 6 lines
How about this:
Setting link parameters on a netdevice changes the value of
if_nlmsg_size(), therefore it is necessary to recalculatemin_ifinfo_dump_size.Sound good... do I have to resubmit the patch with the correct description?
Yes.