-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VLAN generates 2 "new" events #411
Comments
I don't know the answer. Also, you don't show any code, so it's not even clear what "events" exactly are or how you use the API. The first question is to look at the netlink events from kernel. Are they different? If yes, is that a kernel bug? Should libnl try to workaround that? If they are not different, is that a kernel bug? Should there be two events that are the same? Should libnl somehow filter them out? etc. |
Sorry I wasn't very clear. I tested with "nl-monitor -d7 link" but there doesn't seem to be much difference in the log output, I'll attach them here nl-mon-ipv4.txt I have a cache manger setup: _monitor->socket = nl_socket_alloc(); And then I run a test that creates a VLAN (eth0.4) on eth0 in the same way as the example iin "test-create-vlan.c" and then deletes it. When I run with both IPv4 and IPv6 enabled I get 2 calls monitor_link_cache_cb() with NL_ACT_NEW set. I've added this debug patch to libnl (I disabled the hashtable lookup to make debugging easier, hopefully not a problem?):
When running with this patch, I can see this log print for IPv6 and IPv4, where "a" is the cached entry and "b" the new entry: Since this doesn't match it seems that libnl generates a "NL_ACT_NEW" message to the callback. |
I've tested some more and captured logs with NLDBG=5, hopefully this is more helpful. The netlink message that triggers the 2nd NEW callback is at line 3217 in this log: Also I've captured the same log with just ipv4: |
Hi
When creating a new VLAN interface on eth0 it generates 2 NL_ACT_NEW events if IPv6 is active on eth0, this doesn't happen if there is no IPv6.
After some debugging this seems to happen since the l_family of the 2nd event does not match the already cached entry, the cached entry has l_family == 0 but the 2nd has l_family == AF_INET6 and the compare function doesn't match.
Is this intended behavior or is there a work-around to not get the 2nd event since deleting it only generates one event?
The text was updated successfully, but these errors were encountered: