Commit 6d0d95a1 authored by Antony Antony's avatar Antony Antony Committed by Steffen Klassert

xfrm: fix the if_id check in changelink

if_id will be always 0, because it was not yet initialized.

Fixes: 8dce4391 ("xfrm: interface with if_id 0 should return error")
Reported-by: default avatarPavel Machek <pavel@denx.de>
Signed-off-by: default avatarAntony Antony <antony.antony@secunet.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent a6d95c5a
...@@ -673,12 +673,12 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[], ...@@ -673,12 +673,12 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[],
struct net *net = xi->net; struct net *net = xi->net;
struct xfrm_if_parms p = {}; struct xfrm_if_parms p = {};
xfrmi_netlink_parms(data, &p);
if (!p.if_id) { if (!p.if_id) {
NL_SET_ERR_MSG(extack, "if_id must be non zero"); NL_SET_ERR_MSG(extack, "if_id must be non zero");
return -EINVAL; return -EINVAL;
} }
xfrmi_netlink_parms(data, &p);
xi = xfrmi_locate(net, &p); xi = xfrmi_locate(net, &p);
if (!xi) { if (!xi) {
xi = netdev_priv(dev); xi = netdev_priv(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment