Hi Hans, On Mon, Jun 6, 2016 at 1:03 PM, Hans Dedecker <[email protected]> wrote: > As device name is used as key in avl list a device name change will break the > avl find logic. > Function device_set_ifname offers api to set the device name and re-inserts > the avl node in the list > when the avl key value is changed. > > Signed-off-by: Hans Dedecker <[email protected]> > --- > > diff --git a/device.c b/device.c > index 06c4820..7149d86 100644 > --- a/device.c > +++ b/device.c > @@ -422,14 +422,14 @@ void device_init_virtual(struct device *dev, const > struct device_type *type, con > assert(dev); > assert(type); > > - if (name) > - strncpy(dev->ifname, name, IFNAMSIZ); > - > D(DEVICE, "Initialize device '%s'\n", dev->ifname);
Isn't this debug print broken by this change? > INIT_SAFE_LIST(&dev->users); > INIT_SAFE_LIST(&dev->aliases); > dev->type = type; > > + if (name) > + device_set_ifname(dev, name); > + Eyal. _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
