From: Patrick McHardy Date: Thu, 14 Sep 2006 03:35:36 +0000 (-0700) Subject: [RTNETLINK]: Fix netdevice name corruption X-Git-Tag: v3.12-rc1~34044^2~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78e5b8916e7db119850f57ce8548fbb9767078fc;p=kernel%2Fkernel-generic.git [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 Signed-off-by: David S. Miller --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 63b882a..d8e25e0 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);