On 5/27/17 12:00 AM, Roopa Prabhu wrote: > On Fri, May 26, 2017 at 11:18 AM, David Miller <da...@davemloft.net> wrote: >> From: Roopa Prabhu <ro...@cumulusnetworks.com> >> Date: Thu, 25 May 2017 10:42:32 -0700 >> >>> This series adds a new RTM_F_FIB_MATCH flag to return matched fib result >>> with RTM_GETROUTE. This is useful for applications and protocols in >>> userspace wanting to query the selected route. >> >> Looks good, series applied, thanks. >> > > thank you. > >> Have you considered taking this further and allowing one to see which >> nexthop a route lookup picked? > > since the default RTM_GETROUTE output gives most of the attributes > from the resolved dst, > have not considered adding more to it yet...but certainly can if > needed in the future. >
One extension is to pass in prefix and length (plus any options to such as metric to uniquely discriminate a route) and get back the route entry. It is needed to retrieve the BPF code for routes with a bpf encap. This patch set makes it easier.