OSDN Git Service

net: ipv4: Save trie prefix to fib lookup result
authorDavid Ahern <dsahern@gmail.com>
Thu, 25 May 2017 17:42:37 +0000 (10:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 May 2017 18:12:50 +0000 (14:12 -0400)
Prefix is needed for returning matching route spec on get route request.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_fib.h
net/ipv4/fib_trie.c

index 42e8b8f..25f5c51 100644 (file)
@@ -136,6 +136,7 @@ struct fib_rule;
 
 struct fib_table;
 struct fib_result {
+       __be32          prefix;
        unsigned char   prefixlen;
        unsigned char   nh_sel;
        unsigned char   type;
index 6d0f6c7..6e9df7d 100644 (file)
@@ -1452,6 +1452,7 @@ found:
                        if (!(fib_flags & FIB_LOOKUP_NOREF))
                                atomic_inc(&fi->fib_clntref);
 
+                       res->prefix = htonl(n->key);
                        res->prefixlen = KEYLENGTH - fa->fa_slen;
                        res->nh_sel = nhsel;
                        res->type = fa->fa_type;