On 5/27/24 13:00, Roi Dayan via dev wrote:
> Used Ubuntu with gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
>
> lib/netdev-linux.c: In function ‘netdev_linux_construct’:
> lib/netdev-linux.c:7003:15: error: array subscript ‘struct ethtool_cmd[0]’ is
> partly outside array bounds of ‘union <anonymous>[1]’ [-Werror=array-bounds]
> 7003 | ecmd->cmd = cmd;
> | ~~~~~~~~~~^~~~~
> lib/netdev-linux.c:2411:7: note: while referencing ‘sset_info’
> 2411 | } sset_info;
> | ^~~~~~~~~
>
> Fixes: 6c59c195266c ("netdev-linux: Use ethtool to detect offload support.")
> Signed-off-by: Roi Dayan <[email protected]>
> ---
> lib/netdev-linux.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index 0cb379295af1..ec6fcf7b2c6a 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -2402,6 +2402,7 @@ static int
> netdev_linux_read_stringset_info(struct netdev_linux *netdev, uint32_t *len)
> {
> union {
> + struct ethtool_cmd ecmd;
> struct ethtool_sset_info hdr;
> struct {
> uint64_t pad[2];
We need to migrate from the legacy ethtool_cmd API at some point,
but this change makes sense for now.
Applied to main and backported down to 3.3. Thanks!
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev