浏览代码

net: ipv4: Save trie prefix to fib lookup result

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>
David Ahern 8 年之前
父节点
当前提交
6ffd903415
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      include/net/ip_fib.h
  2. 1 0
      net/ipv4/fib_trie.c

+ 1 - 0
include/net/ip_fib.h

@@ -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;

+ 1 - 0
net/ipv4/fib_trie.c

@@ -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;