X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=system-linux.c;h=6a6028c7e64ce3be76ecad022d4feb21396e4565;hb=fe08cfd2bfb389f7c174e2dd1561ba4a381db213;hp=02574fcbeea6f5ab77ad0493c0ccb7d3840d9366;hpb=248ec27b62439662f28deab08adb9ee4e906f3b6;p=project%2Fnetifd.git diff --git a/system-linux.c b/system-linux.c index 02574fc..6a6028c 100644 --- a/system-linux.c +++ b/system-linux.c @@ -316,11 +316,7 @@ static int cb_rtnl_event(struct nl_msg *msg, void *arg) goto out; struct device *dev = device_get(nla_data(nla[IFLA_IFNAME]), false); - if (!dev) - goto out; - - device_set_ifindex(dev, ifi->ifi_index); - if (dev->type->keep_link_status) + if (!dev || dev->type->keep_link_status) goto out; if (!system_get_dev_sysctl("/sys/class/net/%s/carrier", dev->ifname, buf, sizeof(buf))) @@ -497,7 +493,7 @@ int system_bridge_delif(struct device *bridge, struct device *dev) return system_bridge_if(bridge->ifname, dev, SIOCBRDELIF, NULL); } -static int system_if_resolve(struct device *dev) +int system_if_resolve(struct device *dev) { struct ifreq ifr; strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name)); @@ -1006,7 +1002,6 @@ int system_if_up(struct device *dev) { system_if_get_settings(dev, &dev->orig_settings); system_if_apply_settings(dev, &dev->settings, dev->settings.flags); - device_set_ifindex(dev, system_if_resolve(dev)); return system_if_flags(dev->ifname, IFF_UP, 0); }