Skip to contentSkip to conversation

ip route: don't implicitly filter address family

PATCH In review Dan McGee 2 participants 2 messages Jul 15, 2011 – Aug 31, 2011

Subsystems (2)
lore
Share & tools
lore

Dan McGee

author
#0 lore raw

PATCH 1/1 ip route: don't implicitly filter address family

When looking at the output of 'ip route show' on an IPv6 capable machine, the default output doesn't show IPv6 routes. This is unlike any other ip subcommand, which show all address families by default. Furthermore, the behavior is totally bogus for different permutations of the command:

ip route show : will show IPv4, not show IPv6
ip route show table all : will show IPv4 and IPv6 ip route -f link show : will show IPv4 and IPv6

Rectify this behavior by removing some 2004 code that tries to munge the address family if it is unspecified and fails bad at guessing the user's intention.

---
 ip/iproute.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
ip/iproute.c +0 -3
index ca09029..4458d9c 100644
@@ -1236,9 +1236,6 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
 		argc--; argv++;
 	}
 
-	if (do_ipv6 == AF_UNSPEC && filter.tb)
-		do_ipv6 = AF_INET;
-
 	ll_init_map(&rth);
 
 	if (id || od)  {
Signature · 1 line
1.7.6
#1 lore raw
Quoted 24 lines · On Fri, 15 Jul 2011 13:38:33 -0500 Dan McGee <[email protected]> wrote:

When looking at the output of 'ip route show' on an IPv6 capable machine, the default output doesn't show IPv6 routes. This is unlike any other ip subcommand, which show all address families by default. Furthermore, the behavior is totally bogus for different permutations of the command:

ip route show : will show IPv4, not show IPv6
ip route show table all : will show IPv4 and IPv6 ip route -f link show : will show IPv4 and IPv6

Rectify this behavior by removing some 2004 code that tries to munge the address family if it is unspecified and fails bad at guessing the user's intention.

---
 ip/iproute.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
ip/iproute.c +0 -0
index ca09029..4458d9c 100644

ip/iproute.c static int iproute_list_flush_or_save(int argc, char **argv, int action) · line 1241

Quoted 9 lines
ip/iproute.c +0 -3
@@ -1236,9 +1236,6 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
 		argc--; argv++;
 	}
 
-	if (do_ipv6 == AF_UNSPEC && filter.tb)
-		do_ipv6 = AF_INET;
-
 	ll_init_map(&rth);
 
 	if (id || od)  {

No, this will change the output for unsuspecting users and likely break their scripts.