netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: David Ahern <dsa@cumulusnetworks.com>
Subject: [PATCH net-next 5/7] net: ipv4: Save trie prefix to fib lookup result
Date: Mon,  9 Jan 2017 13:32:49 -0800	[thread overview]
Message-ID: <1483997571-3964-6-git-send-email-dsa@cumulusnetworks.com> (raw)
In-Reply-To: <1483997571-3964-1-git-send-email-dsa@cumulusnetworks.com>

Prefix is needed for returning matching route spec on get route request.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
 include/net/ip_fib.h | 1 +
 net/ipv4/fib_trie.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 57c2a863d0b2..f2cc345852d7 100644
--- a/include/net/ip_fib.h
+++ b/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;
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 2919d1a10cfd..2fc5793cce36 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1544,6 +1544,7 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp,
 			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;
-- 
2.1.4

  parent reply	other threads:[~2017-01-09 21:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 21:32 [PATCH net-next 0/7] net: ivp4: return matching route for GETROUTE request David Ahern
2017-01-09 21:32 ` [PATCH net-next 1/7] net: ipv4: refactor __ip_route_output_key_hash David Ahern
2017-01-09 21:32 ` [PATCH net-next 2/7] net: ipv4: refactor ip_route_input_noref David Ahern
2017-01-09 21:32 ` [PATCH net-next 3/7] net: ipv4: Convert inet_rtm_getroute to rcu versions of route lookup David Ahern
2017-01-09 21:32 ` [PATCH net-next 4/7] net: ipv4: refactor fib_dump_info David Ahern
2017-01-09 21:32 ` David Ahern [this message]
2017-01-09 21:32 ` [PATCH net-next 6/7] net: ipv4: return route match in GETROUTE request David Ahern
2017-01-11  1:40   ` David Miller
2017-01-11 17:24     ` David Ahern
2017-01-09 21:32 ` [PATCH net-next 7/7] net: ipv4: Remove event arg to rt_fill_info David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1483997571-3964-6-git-send-email-dsa@cumulusnetworks.com \
    --to=dsa@cumulusnetworks.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).