diff options
author | Antony Antony | 2022-02-01 07:51:57 +0100 |
---|---|---|
committer | Steffen Klassert | 2022-02-03 08:02:05 +0100 |
commit | 6d0d95a1c2b07270870e7be16575c513c29af3f1 (patch) | |
tree | d935f4225ae36a1263a21c4389f4d8c3b5c21625 /net/xfrm/xfrm_interface.c | |
parent | a6d95c5a628a09be129f25d5663a7e9db8261f51 (diff) |
xfrm: fix the if_id check in changelink
if_id will be always 0, because it was not yet initialized.
Fixes: 8dce43919566 ("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>
Diffstat (limited to 'net/xfrm/xfrm_interface.c')
-rw-r--r-- | net/xfrm/xfrm_interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c index 57448fc519fc..4e3c62d1ad9e 100644 --- a/net/xfrm/xfrm_interface.c +++ b/net/xfrm/xfrm_interface.c @@ -673,12 +673,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); |