Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78e5b891 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[RTNETLINK]: Fix netdevice name corruption



When changing a device by ifindex without including a IFLA_IFNAME
attribute, the ifname variable contains random garbage and is used
to change the device name.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d1d9facf
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -394,6 +394,8 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)


	if (tb[IFLA_IFNAME])
	if (tb[IFLA_IFNAME])
		nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
		nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
	else
		ifname[0] = '\0';


	err = -EINVAL;
	err = -EINVAL;
	ifm = nlmsg_data(nlh);
	ifm = nlmsg_data(nlh);