Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 887594 - within /sbin/ip, the nexthop clause does not accept IPv6 addresses, only IPv4 addresses
Summary: within /sbin/ip, the nexthop clause does not accept IPv6 addresses, only IPv4...
Status: CLOSED DUPLICATE of bug 734697
Alias: None
Product: Fedora
Classification: Fedora
Component: iproute
Version: 17
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Petr Šabata
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-12-16 17:47 UTC by Wendell Baker
Modified: 2012-12-20 16:01 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-12-20 16:01:36 UTC
Type: Bug

Attachments (Terms of Use)

Description Wendell Baker 2012-12-16 17:47:14 UTC
Description of problem:

The notion is that only an IPv4 address can appear within a 'nexthop' clause

sudo /sbin/ip -6 route add table mytable to default scope global nexthop via fdd3:1234:1234:0:1:1:2:8002 dev em1 weight 1 nexthop via fdd3:1234:1234:0:1:1:2:8007 dev em1 weight 1
Error: an IP address is expected rather than "fdd3:1234:1234:0:1:1:2:8002"

Not sure there's a workaround here.  I have IPv6 hosts A, B C, D connected as follows

A-+         +-D

I think this utterance is what I need to say.  I have two possibilities
to get from A to D and I want to use both equally.  I utter this route
declaration on A to get traffic back to D via B or C.

[pointless and wrong, but it illustrates that "nexthop via" parsing occurs for IPv4 addresses]
sudo /sbin/ip -6 route add table linode-fremont to default scope global nexthop via dev em1 weight 1 nexthop via dev em1 weight 1
RTNETLINK answers: No such device

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. (as above)
Actual results:

Error: an IP address is expected rather than "fdd3:1234:1234:0:1:1:2:8002/64"

Expected results:

the IPv6 route was added

Additional info:

Somewhere out there, upstream somewhere, someone has put some work
into this.  There is code on github that seems to have IPv6 built
into iproute2.  This is just advice that a solution already exists;
I found it by looking at the Fedora 17 src rpm and then searching for
'parse_one_nh' to see if anyone had coded changes to that function.

To wit:


The function of interest is (at least) parse_one_nh

$ diff $FEDORA17_SRC/iproute-3.3.0-2/ip/iproute.c $WORKAREA/com.github/SamB/iproute2/iproute2/ip/iproute.c 
< int parse_one_nh(struct rtattr *rta, struct rtnexthop *rtnh, int *argcp, char ***argvp)
> int parse_one_nh(struct rtmsg *r, struct rtattr *rta, struct rtnexthop *rtnh, int *argcp, char ***argvp)
> 			inet_prefix addr;
< 			rta_addattr32(rta, 4096, RTA_GATEWAY, get_addr32(*argv));
< 			rtnh->rtnh_len += sizeof(struct rtattr) + 4;
> 			get_addr(&addr, *argv, r->rtm_family);
> 			if (r->rtm_family == AF_UNSPEC)
> 				r->rtm_family = addr.family;
> 			rta_addattr_l(rta, 4096, RTA_GATEWAY, &addr.data, addr.bytelen);
> 			rtnh->rtnh_len += sizeof(struct rtattr) + addr.bytelen;
< 		parse_one_nh(rta, rtnh, &argc, &argv);
> 		parse_one_nh(r, rta, rtnh, &argc, &argv);

Comment 1 Petr Šabata 2012-12-20 16:01:36 UTC

*** This bug has been marked as a duplicate of bug 734697 ***

Note You need to log in before you can comment on or make changes to this bug.