Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 62876 - Restarting net.eth0 prints "RTNETLINK answers: invalid argument", and also does not print dhcp obtained address (using baselayout-1.10.4)
Summary: Restarting net.eth0 prints "RTNETLINK answers: invalid argument", and also do...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 58996 (view as bug list)
Depends on:
Blocks: 66472
  Show dependency tree
 
Reported: 2004-09-04 17:44 UTC by Jonty Pearson
Modified: 2008-03-29 10:13 UTC (History)
1 user (show)

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 Jonty Pearson 2004-09-04 17:44:30 UTC
Using iproute2-style dhcp settings for eth0 and restarting network gives:

 * Bringing eth0 down...
 *   Releasing DHCP lease for eth0                              [ ok ]
 *   Stopping eth0
RTNETLINK answers: Invalid argument                             [ ok ]
 * Bringing eth0 up...
 *   eth0 dhcp                                                  [ ok ]
 *     eth0 received address

Note "RTNETLINK" error and "eth0 received address" doesn't print address.

For non-printing address:
Line 384 in net.eth0:
x=$(ip addr show ${label} 2>${devnull} | awk -v\ i=${label} \
	'NF==i {print $2}' | cut -d/ -f1)
[[ -n ${i} ]] && einfo "    ${label} received a\ddress ${x}"

Should have '$NF==i {print $2}' rather than 'NF==i {print $2}' to grab address.

For RTNETLINK error:
It appears that "iface_stop()" runs "iface_stop_dhcp  {i}" followed by "iface_stop_interface ${i}".  On my network the dhcpcd server stops with iface_stop_dhcp and the address is deleted, and then iface_stop_interface is called and attempts to delete the same address which is now non-existent, giving the RTNETLINK message.
Line 106 in net.eth0:
ip addr del $(ip addr show ${iface%%:*} label ${iface} \
	| awk -v i=${iface} '$NF==i {print $2}') dev ${iface%%:\*}

Which expands to "ip addr del dev eth0" on my machine, giving the error.  Maybe something like the following would work:

x="$(ip addr show ${iface%%:*} label ${iface} \
	| awk -v i=${iface} '$NF==i {print $2}')"
if [[ -n ${x} ]]; then
	ip addr del ${x} dev ${iface%%:\*}
fi


Reproducible: Always
Steps to Reproduce:
1. Do: /etc/init.d/net.eth0 restart
2.
3.

Actual Results:  
 * Bringing eth0 down...
 *   Releasing DHCP lease for eth0                                [ ok ]
 *   Stopping eth0
RTNETLINK answers: Invalid argument                               [ ok ]
 * Bringing eth0 up...
 *   eth0 dhcp                                                    [ ok ]
 *     eth0 received address


Expected Results:  
 * Bringing eth0 down...
 *   Releasing DHCP lease for eth0                                [ ok ]
 *   Stopping eth0                                                [ ok ]
 * Bringing eth0 up...
 *   eth0 dhcp                                                    [ ok ]
 *     eth0 received address 205.250.249.96


I've seen lots of information on the net concerning RTNETLINK errors being due
to kernel configuration, I don't think that's the case here, but I'm no expert...
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2004-10-24 21:46:36 UTC
do you still see this problem with baselayout-1.11.x?
Comment 2 Roy Marples (RETIRED) gentoo-dev 2004-12-06 15:41:38 UTC
This has deffo been fixed in baselayout-1.11.7-r2
Comment 3 Roy Marples (RETIRED) gentoo-dev 2004-12-10 08:02:41 UTC
*** Bug 58996 has been marked as a duplicate of this bug. ***
Comment 4 Jonty Pearson 2004-12-11 12:08:23 UTC
I upgraded baselayout about a month ago and all seems fixed - thanks guys!
Comment 5 Vladimir 2008-03-17 17:37:39 UTC
I've got the same with  [ebuild   R   ] sys-apps/baselayout-1.12.11.1  USE="unicode -bootstrap -build -static" 0 kB after upgrading today. 
Now i switched to ifconfig in conf.d/net but net.lo still down
QWERTY1 ~ # /etc/init.d/net.lo restart
 * One of the files in /etc/{conf.d,init.d} or /etc/rc.conf
 * has a modification time in the future!
 * WARNING:  you are stopping a boot service.
 * Stopping lo
 *   Bringing down lo
 *     Shutting down lo ...
RTNETLINK answers: Invalid argument                                                          [ !! ]
 * Starting lo
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
 *   Bringing up lo
 *     127.0.0.1/8
RTNETLINK answers: Invalid argument                                                          [ ok ]
RTNETLINK answers: Invalid argument
 *   Adding routes
 *     127.0.0.0/8 ...
RTNETLINK answers: Network is down                                                           [ !! ]
QWERTY1 ~ #
Comment 6 Sebastián González 2008-03-22 22:43:26 UTC
bump
Comment 7 Sebastián González 2008-03-29 10:13:44 UTC
To anyone coming across this bug: check bug #213660