A couple of questions about flnl_lookup() function.

Thomas Graf tgraf at infradead.org
Tue Mar 27 04:02:07 EDT 2012


On Wed, Mar 21, 2012 at 11:14:09AM +0400, Someone Strange wrote:
> >./nl-fib-lookup 192.168.1.3
> table main prefixlen 24 next-hop-selector 0
> type unicast scope link error Success (0)
> 
> >./nl-fib-lookup 10.10.5.54
> table main prefixlen 8 next-hop-selector 0
> type unicast scope link error Success (0)
> 
> I also passed 192.168.1.0 and 10.0.0.0 as program argument, but the result is the same: 'next-hop-selector 0'.
> 
> My questions.
> 1. What is the meaning of 'next-hop-selector'? 
> I can't find any descriptions or references to it in libnl documentation. I think it is a interface index for the next-hop interface. Is it right?

It's not yet documented because it's a rarely used feature. Your best bet
is to look at the kernel code to figure out what information is provided
exactly in net/ipv4/fib_frontend.c.

next-hop-selector refers to the nth nexthop that has been selected for a
specific route.

> 2. Which function(s) I need to use for translating 'next-hop-selector' in next-hop interface index (name)? 
> 
> 3. And main question. Why 'next-hop-selector' is always zero in my system?!

Because you have no route with multiple nexthops.



More information about the libnl mailing list