You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
xfrm: fix the if_id check in changelink
commit6d0d95a1c2upstream. if_id will be always 0, because it was not yet initialized. Fixes:8dce439195("xfrm: interface with if_id 0 should return error") Reported-by: Pavel Machek <pavel@denx.de> Signed-off-by: Antony Antony <antony.antony@secunet.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
24efaae03b
commit
2f0e6d80e8
@@ -679,12 +679,12 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[],
|
||||
struct net *net = xi->net;
|
||||
struct xfrm_if_parms p = {};
|
||||
|
||||
xfrmi_netlink_parms(data, &p);
|
||||
if (!p.if_id) {
|
||||
NL_SET_ERR_MSG(extack, "if_id must be non zero");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
xfrmi_netlink_parms(data, &p);
|
||||
xi = xfrmi_locate(net, &p);
|
||||
if (!xi) {
|
||||
xi = netdev_priv(dev);
|
||||
|
||||
Reference in New Issue
Block a user