Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 110956 - Could not bring up net.eth0 with static ips after --update
Summary: Could not bring up net.eth0 with static ips after --update
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-30 16:48 UTC by Jason King
Modified: 2005-11-01 14:45 UTC (History)
0 users

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


Attachments
Fixes the above issue (ifconfig.patch,1.19 KB, patch)
2005-10-31 01:10 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason King 2005-10-30 16:48:02 UTC
With multiple static IPs configured in /etc/conf.d/net my net.eth0 failed to
come up giving a "SIOCSIFFLAGS: Cannot assign requested address" error and an
inet_route usage error.  All was working before a --update with the same
configuration.

Because of the nature of the error with the route (ie. that the route del
succeeds, but the route add fails) then you're left with no routing at all.  So
apparently, no network at all.

/etc/conf.d/net is in Additional Info (no changes to that file between --updates).

The SIOCSIFFLAGS error was on the ``ifconfig "eth0:1" up'' call at
/lib/rcscripts/net.modules.d/ifconfig:74 called from line 393 in same file
(called from interface_add_address in net.lo).

The inet_route usage was caused because the metric assignment on line 406 (of
ifconfig) resulted in an empty string for eth0:1 which meant that the ``route
add'' on line 425 was:

  route add -net 10.5.1.0/24 metric  dev eth0:1

Note the missing value for 'metric'.

I have now hacked around this by putting an if [[ ${metric} != "" ]] above the
route stuff on line 423, which has enabled me to bring the routing up.  The
SIOCSIFFLAGS error continues - but doesn't seem to be having any significant
effect (so I've not done any real troubleshooting on that).

Reproducible: Always
Steps to Reproduce:
1. Set /etc/conf.d/net to (something similar to) the contents shown below in
Additional Info
2. /etc/init.d/net.eth0 restart
3. Cry because you have no routes at all :(

Actual Results:  
 * Stopping eth0
 *   Bringing down eth0
 *     Shutting down eth0:2 ...                                [ ok ]
 *     Shutting down eth0:1 ...                                [ ok ]
 *     Shutting down eth0 ...                                  [ ok ]
 *   Selecting best interface: lo
 * Starting eth0
 *   Bringing up eth0
 *     10.5.1.228                                              [ ok ]
 *     10.5.1.218
SIOCSIFFLAGS: Cannot assign requested address
Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M]
[[dev] If]
       inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M]
                              [netmask N] [mss Mss] [window W] [irtt I]
                              [mod] [dyn] [reinstate] [[dev] If]
       inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject
       inet_route [-FC] flush      NOT supported                               
                           [ ok ]
 *     10.5.1.219
SIOCSIFFLAGS: Cannot assign requested address                                  
                           [ ok ]
 *   Adding routes
 *     default via 10.5.1.1 ...
SIOCADDRT: Network is unreachable                                              
                          [ !! ]
 *   Selecting best interface: lo


Expected Results:  
Trouble-free network upness.

== /etc/conf.d/net ==
config_eth0=( "10.5.1.228/24 brd 10.5.1.255"
              "10.5.1.218/24 brd 10.5.1.255"
              "10.5.1.219/24 brd 10.5.1.255"
            )
routes_eth0=( "default via 10.5.1.1" )
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-10-30 22:55:46 UTC
Honestly, I'd strongly suggest to use iproute2 for these types of configuration,
instead of ifconfig that has been deprecated for ages.
Comment 2 Roy Marples (RETIRED) gentoo-dev 2005-10-31 01:10:18 UTC
Created attachment 71778 [details, diff]
Fixes the above issue

Reporter, please test the above patch to see if it fixes your issue.
If you emerged iproute2 as advised by jakub, please remove it if you wish to
test the patch.
Comment 3 Jason King 2005-11-01 01:20:15 UTC
The problem is at work, I'm at home right now - so will try tomorrow.

Regarding this other issue of ifconfig being deprecated, thanks for the heads
up.  How should I have known about this?  Would this have been in some merge
output somewhere and I just didn't notice?  (Please ignore if this is entirely
the wrong forum for these sorts of questions ;)
Comment 4 Roy Marples (RETIRED) gentoo-dev 2005-11-01 03:28:08 UTC
Only the Linux kernel guys claim net-tools (ifconfig) is deprecated.
It's not on Gentoo at this time as other things aside from our net scripts
depend on net-tools.
Comment 5 Jason King 2005-11-01 14:45:07 UTC
Back at work right now, and have just tried the patch in ifconfig, it worked and
I have zero errors now.  Thanks - I've marked this as FIXED.

Thanks also Roy for your clarification about the status of ifconfig.  I'll stick
with it for now.