summaryrefslogtreecommitdiff
path: root/net/xfrm
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2019-07-15 12:00:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-27 14:51:01 +0100
commit6f8fa5c32d687b61d5c13d225c40f9b3714bdb1e (patch)
tree199c19cf6e7121513ff0229e44f854e4392f728f /net/xfrm
parent8ce259e5b003c0838c12752584254e310ddf3191 (diff)
xfrm interface: ifname may be wrong in logs
[ Upstream commit e0aaa332e6a97dae57ad59cdb19e21f83c3d081c ] The ifname is copied when the interface is created, but is never updated later. In fact, this property is used only in one error message, where the netdevice pointer is available, thus let's use it. Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_interface.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index d6a3cdf7885c..4ee512622e93 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -145,8 +145,6 @@ static int xfrmi_create(struct net_device *dev)
if (err < 0)
goto out;
- strcpy(xi->p.name, dev->name);
-
dev_hold(dev);
xfrmi_link(xfrmn, xi);
@@ -293,7 +291,7 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
if (tdev == dev) {
stats->collisions++;
net_warn_ratelimited("%s: Local routing loop detected!\n",
- xi->p.name);
+ dev->name);
goto tx_err_dst_release;
}
@@ -648,12 +646,6 @@ static int xfrmi_newlink(struct net *src_net, struct net_device *dev,
int err;
xfrmi_netlink_parms(data, &p);
-
- if (!tb[IFLA_IFNAME])
- return -EINVAL;
-
- nla_strlcpy(p.name, tb[IFLA_IFNAME], IFNAMSIZ);
-
xi = xfrmi_locate(net, &p);
if (xi)
return -EEXIST;