[OpenWrt-Devel] [PATCH 1/4] netifd: Fix device ifindex overwrite when processing netlink event messages
nbd at openwrt.org
Thu Nov 13 09:00:52 EST 2014
On 2014-11-13 14:35, Hans Dedecker wrote:
> When a device with the same name is deleted and created again in the kernel
> the ifindex changes.
> A race condition will occur when netlink event messages linked to the old device
> are processed and will thus overwrite the correct ifindex of the new device.
> Further make sure a valid ifindex is in place for both external and internal
> devices when setting the state to enabled.
> Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
> diff --git a/system-dummy.c b/system-dummy.c
> index 8e420e1..94b3308 100644
> --- a/system-dummy.c
> +++ b/system-dummy.c
> @@ -96,6 +96,13 @@ int system_if_check(struct device *dev)
> return 0;
> +int system_if_resolve(struct device *dev)
> + dev->ifindex = 0;
> + return 0;
You can leave out the dev->ifindex assignment here.
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
More information about the openwrt-devel