bug in nl_cache_refill?

Brett Ciphery brett.ciphery at windriver.com
Wed Feb 8 16:51:54 EST 2012


I am periodically calling nl_cache_refill to clean and update a cache,
but after some time it starts throwing errors.  As an (ugly) example:

nl_sock = nl_socket_alloc();
nl_cache_mngr_alloc(nl_sock, NETLINK_ROUTE,
NL_AUTO_PROVIDE, &mngr);
nl_cache_mngr_add(mngr, "route/route", NULL,
NULL, &route_cache);

while(true) {
	err = nl_cache_refill(nl_sock,
route_cache);
                printf("err code refilling route cache: %d\n", err);
                sleep(1);
}


err code refilling route cache: 0
err code refilling route cache: 0
...
err code refilling route cache: -25
err code refilling route cache: 0
err code refilling route cache: -25
err code refilling route cache: 0
err code refilling route cache: -25
err code refilling route cache: 0
err code refilling route cache: 0
err code refilling route cache: -25
err code refilling route cache: 0
...

Which comes from lib/nl.c:719, indicating an NLE_BUSY, or, -EBUSY
syserr.  This leaves a previously populated cache empty for a
(seemingly) non-critical error.  What do you think about handling
-NLE_BUSY inside nl_cache_refill, just as we do -NLE_DUMP_INTR?

Brett



More information about the libnl mailing list