[dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix invalid network interface index value

Yongseok Koh yskoh at mellanox.com
Wed Jul 25 19:04:32 CEST 2018


> On Jul 25, 2018, at 4:24 AM, Adrien Mazarguil <adrien.mazarguil at 6wind.com> wrote:
> 
> Network interface indices being unsigned, an invalid index or error is
> normally expressed through a zero value (see if_nametoindex()).
> 
> mlx5_ifindex() has a signed return type for negative values in case of
> error. Since mlx5_nl.c does not check for errors, these may be fed back as
> invalid interfaces indices to subsequent system calls. This usage would
> have been correct if mlx5_ifindex() returned a zero value instead.
> 
> This patch makes mlx5_ifindex() unsigned for convenience.
> 
> Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
> Cc: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> Cc: stable at dpdk.org
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> Acked-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> ---
Acked-by: Yongseok Koh <yskoh at mellanox.com>
 
Thanks


More information about the stable mailing list