From: Patrick McHardy <kaber@trash.net>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Thomas Graf <tgraf@suug.ch>, Linux Netdev List <netdev@vger.kernel.org>
Subject: [IPROUTE]: Support IPv6 routing table filter
Date: Thu, 10 Aug 2006 22:42:58 +0200 [thread overview]
Message-ID: <44DB9A52.5020501@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
Support IPv6 routing table filter in presence of multiple tables,
f.e. "ip -6 route list table 123". Compatibility is preserved for
kernels not supporting multiple IPv6 tables.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1541 bytes --]
[IPROUTE]: Support IPv6 routing table filter
The current behaviour for IPv6 routing table filters is to derive the
table from the route type. This doesn't really work anymore now that IPv6
supports multiple tables. Add detection for IPv6 multiple table support
(relying on the fact that the first routes dumped belong to the local table
and have rtm_table == RT_TABLE_LOCAL with multiple tables) and handle it
like other protocols.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit 14d210c56edd67973439acd67d916de84a6e0384
tree 5678d9dba5c1b8a0b25133a89bce5d4e473a1160
parent e81c1a22cd2408a8b490ce39bf6ece2d19919a3b
author Patrick McHardy <kaber@trash.net> Thu, 10 Aug 2006 22:39:21 +0200
committer Patrick McHardy <kaber@trash.net> Thu, 10 Aug 2006 22:39:21 +0200
ip/iproute.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 8f4a55d..1645f0b 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -138,6 +138,7 @@ int print_route(const struct sockaddr_nl
inet_prefix prefsrc;
inet_prefix via;
int host_len = -1;
+ static int ip6_multiple_tables;
SPRINT_BUF(b1);
@@ -163,7 +164,10 @@ int print_route(const struct sockaddr_nl
else if (r->rtm_family == AF_IPX)
host_len = 80;
- if (r->rtm_family == AF_INET6) {
+ if (r->rtm_family == AF_INET6 && r->rtm_table != RT_TABLE_MAIN)
+ ip6_multiple_tables = 1;
+
+ if (r->rtm_family == AF_INET6 && !ip6_multiple_tables) {
if (filter.tb) {
if (filter.tb < 0) {
if (!(r->rtm_flags&RTM_F_CLONED))
next reply other threads:[~2006-08-10 20:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-10 20:42 Patrick McHardy [this message]
2006-08-10 20:57 ` [IPROUTE]: Support IPv6 routing table filter Stephen Hemminger
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=44DB9A52.5020501@trash.net \
--to=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@osdl.org \
--cc=tgraf@suug.ch \
/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).