diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a8a5093a3001..02e8bf084277 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -580,7 +580,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
580 | 580 | ||
581 | err = -EINVAL; | 581 | err = -EINVAL; |
582 | ifm = nlmsg_data(nlh); | 582 | ifm = nlmsg_data(nlh); |
583 | if (ifm->ifi_index >= 0) | 583 | if (ifm->ifi_index > 0) |
584 | dev = dev_get_by_index(ifm->ifi_index); | 584 | dev = dev_get_by_index(ifm->ifi_index); |
585 | else if (tb[IFLA_IFNAME]) | 585 | else if (tb[IFLA_IFNAME]) |
586 | dev = dev_get_by_name(ifname); | 586 | dev = dev_get_by_name(ifname); |
@@ -672,7 +672,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
672 | * name provided implies that a name change has been | 672 | * name provided implies that a name change has been |
673 | * requested. | 673 | * requested. |
674 | */ | 674 | */ |
675 | if (ifm->ifi_index >= 0 && ifname[0]) { | 675 | if (ifm->ifi_index > 0 && ifname[0]) { |
676 | err = dev_change_name(dev, ifname); | 676 | err = dev_change_name(dev, ifname); |
677 | if (err < 0) | 677 | if (err < 0) |
678 | goto errout_dev; | 678 | goto errout_dev; |
@@ -740,7 +740,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
740 | return err; | 740 | return err; |
741 | 741 | ||
742 | ifm = nlmsg_data(nlh); | 742 | ifm = nlmsg_data(nlh); |
743 | if (ifm->ifi_index >= 0) { | 743 | if (ifm->ifi_index > 0) { |
744 | dev = dev_get_by_index(ifm->ifi_index); | 744 | dev = dev_get_by_index(ifm->ifi_index); |
745 | if (dev == NULL) | 745 | if (dev == NULL) |
746 | return -ENODEV; | 746 | return -ENODEV; |