Re: libnl bug.



On Fri, 2005-11-25 at 22:19 +0100, Thomas Graf wrote:

> If this backtrace is correct then this is not a libnl bug but rather
> a illegal use of the interface. What link do you expect to be changed
> with old=0x0?
>
> `old' is supposed to point to the link subject to be changed, `tmpl'
> must contain the attributes to be changed. This separation is required
> because the kernel interface allows the to be changed link being
> identified by name or by index. Typically `old' points to a link object
> out of a cache but may also just contain the ifindex or name attribute
> the latter preventing the interface name to be changed.

Hm, okay.

I think libnl should handle NULL pointers on its public interfaces but,
ignoring that, I debugged the problem a bit more.

nm_system_device_set_up_down_with_iface() :: src/NetworkManagerSystem.c
is called after a device goes down, which includes after a device is
removed.  I think this may be the problem.

It calls iface_to_rtnl_link(), which in turn calls
rtnl_link_get_by_name() on the iface.  This returns NULL.

We then pass this pointer to an rtnl_link structure, NULL, into
rtnl_link_change(), where we segfault.

We should not have any expectation here that the interface is still
around, right Dan?

And the interface is definitely down -- the whole device has been
removed -- so if rtnl_link_get_by_name() returns NULL, we are well
passed needing to down the thing, so we should not call
rtnl_link_change().

Makes sense?  Either way, we probably want that NULL check, so I will
check it in.

	Robert Love





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]