提交 6e201c85 编写于 作者: B Ben Hutchings 提交者: David S. Miller

ethtool: Document the general convention for VLAs in kernel space

Various ethtool command structures are declared with zero-length array
at the end which are intended to be variable-length in userland
(relying on lack of compiler bounds checking).  However, in the kernel
the structure and array are always allocated and passed to driver
operations separately.  Make that explicit.
Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f432c095
...@@ -183,6 +183,9 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) ...@@ -183,6 +183,9 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
* hold the RTNL lock. * hold the RTNL lock.
* *
* See the structures used by these operations for further documentation. * See the structures used by these operations for further documentation.
* Note that for all operations using a structure ending with a zero-
* length array, the array is allocated separately in the kernel and
* is passed to the driver as an additional parameter.
* *
* See &struct net_device and &struct net_device_ops for documentation * See &struct net_device and &struct net_device_ops for documentation
* of the generic netdev features interface. * of the generic netdev features interface.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册