net/bonding: fix socket ID check
authorChengchang Tang <tangchengchang@huawei.com>
Tue, 27 Apr 2021 11:39:41 +0000 (19:39 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 27 Apr 2021 12:48:08 +0000 (14:48 +0200)
commitf294e04851fda95ef7842319865d53d2df0da0d1
treed9d8f21411ee255c677b2702e9cc3962d5bebaa8
parentea2066b13f4df6cbfef313c88e139102fedf9b35
net/bonding: fix socket ID check

The socket ID entered by user is cast to an unsigned integer. However,
the value may be an illegal negative value, which may cause some
problems. In this case, an error should be returned.

In addition, the socket ID may be an invalid positive number, which is
also processed in this patch.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/bonding/rte_eth_bond_args.c
drivers/net/bonding/rte_eth_bond_pmd.c