summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPatrick McHardy2006-09-14 05:35:36 +0200
committerDavid S. Miller2006-09-23 00:18:50 +0200
commit78e5b8916e7db119850f57ce8548fbb9767078fc (patch)
tree1aa44a67101b354279d4edc98afc6c4ae1389a88 /net/core
parent[XFRM]: remove xerr_idxp from __xfrm_policy_check() (diff)
downloadkernel-qcow2-linux-78e5b8916e7db119850f57ce8548fbb9767078fc.tar.gz
kernel-qcow2-linux-78e5b8916e7db119850f57ce8548fbb9767078fc.tar.xz
kernel-qcow2-linux-78e5b8916e7db119850f57ce8548fbb9767078fc.zip
[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: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/rtnetlink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 63b882ac288a..d8e25e08cb7e 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -394,6 +394,8 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
if (tb[IFLA_IFNAME])
nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
+ else
+ ifname[0] = '\0';
err = -EINVAL;
ifm = nlmsg_data(nlh);