[OpenWrt-Devel] [PATCH 1/4] netifd: Fix device ifindex overwrite when processing netlink event messages

Hans Dedecker dedeckeh at gmail.com
Thu Nov 13 09:34:59 EST 2014


On Thu, Nov 13, 2014 at 3:00 PM, Felix Fietkau <nbd at openwrt.org> wrote:

> 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.
>
> - Felix
>
OK will do

Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20141113/c69000c9/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list