diff options
author | Patrick McHardy <kaber@trash.net> | 2006-09-13 23:35:36 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 18:18:50 -0400 |
commit | 78e5b8916e7db119850f57ce8548fbb9767078fc (patch) | |
tree | 1aa44a67101b354279d4edc98afc6c4ae1389a88 /net/core | |
parent | d1d9facfd1b326e0df587c96f0ee55de2ae9f946 (diff) |
[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.c | 2 |
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) | |||
394 | 394 | ||
395 | if (tb[IFLA_IFNAME]) | 395 | if (tb[IFLA_IFNAME]) |
396 | nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ); | 396 | nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ); |
397 | else | ||
398 | ifname[0] = '\0'; | ||
397 | 399 | ||
398 | err = -EINVAL; | 400 | err = -EINVAL; |
399 | ifm = nlmsg_data(nlh); | 401 | ifm = nlmsg_data(nlh); |