Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447310 - sys-apps/openrc - Fix family selection of routes_<dev> in /etc/init.d/net.lo
Summary: sys-apps/openrc - Fix family selection of routes_<dev> in /etc/init.d/net.lo
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 439098
  Show dependency tree
 
Reported: 2012-12-15 03:54 UTC by Mihai Moldovan
Modified: 2012-12-21 12:38 UTC (History)
3 users (show)

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


Attachments
Patch to fix the address family selection in net.lo. (address_family_selection.patch,855 bytes, patch)
2012-12-15 03:55 UTC, Mihai Moldovan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Moldovan 2012-12-15 03:54:16 UTC
We're currently unable to use a route clause like this, due a bug in net.lo:

routes_<dev>="-6 default dev <dev>"

Judging from the code of _add_route in iproute2.sh and ifconfig.sh, this should be supported, however net.lo is messing the address family selection up by placing a -net or -host in front of the command (which is later stripped anyway, at least in iproute2.sh.)

My patch will correct the behavior and let you choose the address family like it was intended to.

Side note: some people may say this is unnecessary, but there is at least one corner case, in which address family selection is mandatory:

# Create the IPv6 sit tunnel 'ipv6'.
iptunnel_ipv6="mode sit remote <remote> local <local>"
mtu_ipv6="1280"

config_ipv6="null"

# Add addresses to my bridge br0 (gluing LAN and WiFi interfaces together.)
# Note, that the device ipv6 is not assigned any address!
config_br0="192.168.0.1/24
${IPV6_PREFIX}::1/64"

# Now, we have to add ipv6 as our default IPv6 gateway, but we can't use "via", as there is no address assigned to ipv6 *directly* but rather to the bridge br0, and the link local address is autogenerated and probably not usable anyway.
routes_ipv6="-6 default dev ipv6"


Also, trying to use 'routes_ipv6="default dev ipv6"' would work, but this command is defaulting to the IPv4 address family and... let's just say we don't really want to set a sit tunnel as our default IPv4 gateway.

Reproducible: Always




Patch against /etc/init.d/net.lo as shipped by sys-apps/openrc-0.11.8.
Comment 1 Mihai Moldovan 2012-12-15 03:55:24 UTC
Created attachment 332338 [details, diff]
Patch to fix the address family selection in net.lo.
Comment 2 William Hubbs gentoo-dev 2012-12-20 22:06:26 UTC
Your patch is applied in commit a61fdd0.
Thanks for the report.