Netlink filter function error
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Message-ID | <8ln.9Qkk.1TzvVvrXaxf.1N}[email protected]> |
Hi guys,
I'm quite new to keepalived (few days) and I experienced "Netlink: filter
function error". I had a short look into the source code and I found that
this is caused by interface change during keepalived was running (could be
solved by SIGHUP). Technically speaking, netlink_reflect_filter was not able
to find interface by its index (in my situation -- I cannot exclude other
situations that could cause this message). My situation is that I often
switch interfaces and kernel assigns new index numbers for them.
Would it be a big mistake to try to update or add interface when this
problem is encountered? IMHO we have all the information we need since
kernel sent RTM_NEWLINK message, right?
Ok, talk is cheap, show me the code :-).
Original code in netlink_reflect_filter:
/* find the interface_t */
ifp = if_get_by_ifindex(ifi->ifi_index);
if (!ifp)
return -1;
My idea:
/* find the interface_t */
ifp = if_get_by_ifindex(ifi->ifi_index);
if (!ifp) {
// get name
name = (char *) RTA_DATA(tb[IFLA_IFNAME]);
// lookup by name
ifp = if_get_by_ifname(name);
// update index
if (ifp) {
ifp->index = ifi->ifi_index;
} else {
return -1; // or even better: netlink_if_link_filter(snl, h); plus try
to get ifp again???
}
}
Now tell me why is my idea wrong :-).
Thanks a lot,
Luciano.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel