Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 398721 - openrc regression for IPv6 addresses with additional iproute2 attributes
Summary: openrc regression for IPv6 addresses with additional iproute2 attributes
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: AMD64 Linux
: Normal major
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
Depends on:
Blocks: 398727
  Show dependency tree
 
Reported: 2012-01-13 01:08 UTC by Troy Ablan
Modified: 2013-04-25 23:08 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Ablan 2012-01-13 01:08:55 UTC
With this config in /etc/conf.d/net: 

config_eth1="2001:470:f211:6::c07/64
2001:470:f211:6::ca07/64 preferred 0
2001:470:f211:6::cb07/64 preferred 0
2001:470:f211:6::cc07/64 preferred 0
2001:470:f211:6::a:d03/64 preferred 0"


In openrc-0.8.3-r1, /etc/init.d/net.eth1 start will bring the interface up, and properly add all addresses, with the preferred 0 attribute applied to the address as configured.  In openrc-0.9.4 and openrc-0.9.8, the /etc/init.d/net.eth1 script will bring up the first address, but will cause runscript.sh to spin and consume 100% CPU while trying to bring up the second address.  It will hang until interrupted with ^C.

Reproducible: Always

Steps to Reproduce:
1. Configure /etc/conf.d/net with "preferred 0" after IPv6 addresses as noted in the example of the bug description
2. Start the relevant interface such as through: /etc/init.d/net.eth1 start
3. Watch the init script hang and never return
Actual Results:  
network init script does not complete setting up the configured addresses and instead hangs

Expected Results:  
network init script adds all addresses with appropriate attributes, and returns control to the shell

I'm not even sure if this is the correct way to deprecate an IPv6 address in openrc, or if there is another preferred way.  Since this worked correctly in the past, I'd consider it a regression.  I'm currently back on 0.8.3-r1 rather than trying to hack around it.
Comment 1 Troy Ablan 2012-01-13 01:10:47 UTC
Just to clarify

0.8.3-r1: WORKS
0.9.4: BROKEN
0.9.8: BROKEN
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-01-13 04:32:22 UTC
workaround for now, spell out the option fully instead of compressing it.
so preferred_lft instead of preferred.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-01-13 04:39:39 UTC
fixed in commit e7649f1
Comment 4 Troy Ablan 2012-01-13 22:28:46 UTC
Thanks for looking into it, but it's not quite fixed.  Both the patched and unpatched versions (including your workaround) do not take into account that the string preferred_lft itself must be on the command line before its argument.

With /etc/conf.d/net as:

config_eth1="2001:470:f211:6::c07/64
2001:470:f211:6::ca07/64 preferred_lft 0
2001:470:f211:6::cb07/64 preferred_lft 0
2001:470:f211:6::cc07/64 preferred_lft 0
2001:470:f211:6::a:d03/64 preferred_lft 0"


The output of /etc/init.d/net.eth1 start is thus:


 * Bringing up interface eth1
 *   2001:470:f211:6::c07/64 ...                                                                                        [ ok ]
 *   2001:470:f211:6::ca07/64 ...
Error: either "local" is duplicate, or "0" is a garbage.                                                                [ !! ]
 *   2001:470:f211:6::cb07/64 ...
Error: either "local" is duplicate, or "0" is a garbage.                                                                [ !! ]
 *   2001:470:f211:6::cc07/64 ...
Error: either "local" is duplicate, or "0" is a garbage.                                                                [ !! ]
 *   2001:470:f211:6::a:d03/64 ...
Error: either "local" is duplicate, or "0" is a garbage.                                                                [ !! ]



For all of the arguments anycast|label|scope|valid_lft|preferred_lft|a*|l*|s*|v*|pr*, it assigns the parameter to the appropriate variable.  However, it assigns only the argument, but not the option name.

I believe in your patched version,

The line:

eval "$x=$1" ; shift ;;

Should read something like

eval "$x=\"$x $1\"" ; shift ;;
Comment 5 Troy Ablan 2012-01-13 22:47:58 UTC
As requested on IRC, 

"<robbat2> can you add the output of /etc/init.d/net.eth1 --verbose start"

 * Bringing up interface eth1
 *   Loaded modules: apipa arping bonding tuntap ccwgroup macchanger macnet wpa_supplicant ssidnet iproute2 system vlan dhcpcd ip6to4
 *   Configuring eth1 for MAC address 00:30:48:65:85:4D ... [ ok ]
 *   2001:470:f211:6::c07/64 ...
 *     ip addr add 2001:470:f211:6::c07/64 dev eth1
 [ ok ]
 *   2001:470:f211:6::ca07/64 ...
 *     ip addr add 2001:470:f211:6::ca07/64 dev eth1 0
Error: either "local" is duplicate, or "0" is a garbage.
 [ !! ]
 *   2001:470:f211:6::cb07/64 ...
 *     ip addr add 2001:470:f211:6::cb07/64 dev eth1 0
Error: either "local" is duplicate, or "0" is a garbage.
 [ !! ]
 *   2001:470:f211:6::cc07/64 ...
 *     ip addr add 2001:470:f211:6::cc07/64 dev eth1 0
Error: either "local" is duplicate, or "0" is a garbage.
 [ !! ]
 *   2001:470:f211:6::a:d03/64 ...
 *     ip addr add 2001:470:f211:6::a:d03/64 dev eth1 0
Error: either "local" is duplicate, or "0" is a garbage.
 [ !! ]
 *   Adding routes
 *     default via 2001:470:f211:6::1 ... [ ok ]
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-01-13 23:58:52 UTC
Troy's problem was a false negative. He had applied my patch from the commit on top of 0.9.4, and while it applied cleanly, it was dependant on other post-0.9.4 changes, so it didn't work for him.