No subject

Hanks Wang Hanks.Wang at
Tue Apr 17 05:51:25 EDT 2012

Hi all,

In libnl3, I found a little problem.
When use NL_AUTO_PROVIDE as the third parameter for rtnl_route_alloc_cache, some routing info has been lost! Then use rtnl_route_get_flags to get flags, the result of flags is right.
Use 0 as the third parameter "int flags" for rtnl_route_alloc_cache, the routing info is correct, but then use rtnl_route_get_flags to get flags, it will always return zero.

I found that GNOME group also found this problem, but I have not found the similar bug in our bug queue. How to understand this problem?

uint32_t rtnl_route_get_flags(struct rtnl_route *route)
                return route->rt_flags;

int rtnl_route_alloc_cache(struct nl_sock *sk, int family, int flags,
                                                   struct nl_cache **result)
                struct nl_cache *cache;
                int err;

                if (!(cache = nl_cache_alloc(&rtnl_route_ops)))
                                return -NLE_NOMEM;

                cache->c_iarg1 = family;
                cache->c_iarg2 = flags;

                if (sk && (err = nl_cache_refill(sk, cache)) < 0) {
                                return err;

                *result = cache;
                return 0;

Reference for GNOME on this libnl issue:

Yours sincerely,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the libnl mailing list