Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 433012 - sys-apps/openrc-0.10.5 fails to add static IPv6 routes
Summary: sys-apps/openrc-0.10.5 fails to add static IPv6 routes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
: 433010 (view as bug list)
Depends on:
Blocks: 417391
  Show dependency tree
 
Reported: 2012-08-27 23:34 UTC by Andreas Steinmetz
Modified: 2013-04-25 23:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
proof of concept patch (iproute2.sh.patch,722 bytes, patch)
2012-08-27 23:36 UTC, Andreas Steinmetz
Details | Diff
iproute2-carrier.patch (iproute2-carrier.patch,584 bytes, patch)
2012-08-31 13:43 UTC, William Hubbs
Details | Diff
iproute2-carrier.patch (iproute2-carrier.patch,582 bytes, patch)
2012-09-07 17:28 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Steinmetz 2012-08-27 23:34:40 UTC
Due to /lib64/rc/net/iproute2.sh not waiting for DAD to complete prior to adding routes all static IPv6 routes defined in /etc/conf.d/net will not be added as "ip" fails with EINVAL until DAD is complete.
Furthermore _iproute2_ipv6_tentative() in this script is somewhat broken as when it is called "ip addr" may still output NO-CARRIER so waiting for the interface to really be up can fail for IPv6, too.


Reproducible: Always
Comment 1 Andreas Steinmetz 2012-08-27 23:36:39 UTC
Created attachment 322402 [details, diff]
proof of concept patch

The patch fixes for me the IPv6 route problem bit I do see it more as a proff on concept than a proper solution. At least it shows what's required before adding static IPv6 routes.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-08-28 03:46:09 UTC
*** Bug 433010 has been marked as a duplicate of this bug. ***
Comment 3 William Hubbs gentoo-dev 2012-08-31 13:43:30 UTC
Created attachment 322637 [details, diff]
iproute2-carrier.patch

I found that we have a stub function in iproute2.sh to check for a
carrier. This patch implements that function and uses it in the
tentative check.

Can you please apply this patch instead of the one above and let me know
if it works?

Thanks much,

William
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-09-06 19:09:47 UTC
Here's a testcase that breaks your check:
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000

That interface does NOT have 'NO-CARRIER', yet it's clearly not going to have carrier. It's down!
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-09-06 19:17:31 UTC
Can we just wait for tentative to be gone? Rather than NO-CARRIER?
Comment 6 William Hubbs gentoo-dev 2012-09-07 17:28:21 UTC
Created attachment 323148 [details, diff]
iproute2-carrier.patch

@robbat2:
I found on the net that the LOWER_UP flag means the interface is
connected to a network. Given that definition, I am thinking this patch
will take care of the issue.

We can't use /sys/class/net/$IFACE/carrier, because the results from it
are not consistent. For example, cat /sys/class/net/sit0/carrier gives
an "invalid argument" error message instead of returning 0/1.

What are your thoughts?
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-09-07 18:20:13 UTC
EINVAL from the carrier file is returned at any time where the state of the carrier is undefined.

Your patch should be fine.
Comment 8 William Hubbs gentoo-dev 2012-09-07 22:26:03 UTC
This is implemented in commit 444bdfb.