rtnl_route_get_iif always returns 0.

Ed Slas ESlas at westell.com
Fri May 24 11:16:46 EDT 2013


I am running V 3.2.22 on an embedded linux (coldfire CPU) Kernel Version 2.6.38.

I am able to get a list of the routing table entries, but all of the 'iff''s are 0.
I call:
ret = rtnl_route_alloc_cache (
            sock,           //struct nl_sock *    sk,
            AF_INET,        //int     family,
            0,              //int     flags,
            &route_cache    //struct nl_cache **  result
        );

    nl_cache_foreach(

            route_cache,

            process_route,

            NULL);
...And....

void process_route(struct nl_object *rt, void *unused)
{
    struct rtnl_route *pst_route = (struct rtnl_route *)rt;

    unsigned char protocol = rtnl_route_get_protocol(pst_route);

    unsigned char scope = rtnl_route_get_scope(pst_route);

    unsigned int priority = rtnl_route_get_priority(pst_route);

    int iff = rtnl_route_get_iif(pst_route);
...

 

rtnl_route_get_iif returns 0 for every route. 

 

I can use the iproute2 tool "ip route show" on the same system, and it properly shows the device names. 
Any ideas on why the destination interface id's are not in the route_cache?

The IFF is an attribute in the netlink response. Is there a way to check to see if the IFF attribute was in the response?

Thanks,
Ed


***************************************************************************************
This e-mail and its attachments are private and may contain confidential and proprietary information that is protected. 
If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the 
information contained in or attached to this message is strictly prohibited. If you have received this e-mail in error, 
please notify the sender by replying to this message, and then delete it from your system.  Thank you.



More information about the libnl mailing list