Hello! Found two stuff in /lib/rcscripts/net.modules.d/helpers.d/udhcpc-ifconfig, belonging to the package: sys-apps/baselayout-1.11.14-r3 Number one I'm sure is wrong, number two I'm not sure....here we go... **1** The code on line 40 sets the variable 'cur' to be 'ip broadcast' instead of what I believe should be 'ip netmask'. This causes 'cur' to always differ from 'ip subnet' on line 41, thus causing the code inside the 'if' statement to always be executed. Me thinks that the first print on line 40 should be: "print $2,$4" LINE 40: cur=$( ifconfig ${interface} | grep 'inet ' | awk -F: '{ print $2,$3 }' | awk '{ print $1,$3 }' ) LINE 41: if [[ ${cur} != "${ip} ${subnet}" || ${action} == deconfig ]]; then **2** Maybe line 71 should be "route del default" instead of "route del 0.0.0.0". If I run 'route del 0.0.0.0' on my computer I get an error and the route is still there. > route del 0.0.0.0 SIOCDELRT: No such process If I run 'route del default' the route dissapears like it should. LINE 71: /sbin/route del 0.0.0.0 2>/dev/null || break ***** > ls -l /etc/make.profile lrwxrwxrwx 1 root root 48 Feb 5 02:17 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2006.0 > route --version net-tools 1.60 route 1.98 (2001-04-15) > ifconfig --version net-tools 1.60 ifconfig 1.42 (2001-04-13) > awk --version GNU Awk 3.1.4 > grep --version grep (GNU grep) 2.5.1
Created attachment 79597 [details, diff] fixes udhcpc-ifconfig Your changes are valid, so here's a patch for you to test.
> Your changes are valid, so here's a patch for you to test. I was looking more into the router configuration and there seems to be another issue. The current code deletes all default routers for all interfaces. Since it is possible to have a default route configured for each interface I propose that the code should instead only delete the default route for the interface it is configuring. Following code is my proposal. I removed the innermost while true loop since it is not needed anymore, and I changed one comment. if [[ ${dhcp} != *' nogateway '* ]]; then # Configure default route for the interface. for r in ${router}; do /sbin/route del default dev ${interface} 2>/dev/null # We can only have one default route! /sbin/route add default gw ${r} dev ${interface} && break done fi
Sorry, not going todo that. We have code to handle that in 1.12.0_pre15 already.
nice :) ok..the patch applies fine, and my original problem with loosing my iptables state tables every half hour when dhcp kicks in is gone with the wind now. Thanks for your fast response. Gentoo rocks :) I'll read up on the FAQ so I don't violate the rules next time I send a bug report :).....only the 'cur' stuff was related to my problem, the 'del default' stuff I just found as a bonus while looking for the solution to the 'cur' bug. I'm unsure what to do now, if I should change the status of the bug or something, or leave it like it is, so I guess I will just leave it like it is. Continue the good work of producing the best Linux distribution, the portage system is what makes the difference!
> ok..the patch applies fine, and my original problem with loosing my iptables > state tables every half hour when dhcp kicks in is gone with the wind now. Ooops. It should read iptables connection tracking states. Sorry for spamming the comment section :)
Fixed in baselayout-1.11.14-r5