Re: Netlink filter function error

xcf733520 <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[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.
>
>
>?
Hi Luciano,
	you can update the newest original code,  fixed this error.
Changelog was showed this error in the 665 line.

Thanks a lot,
helu
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.