Summary: | sys-apps/openrc: network routes set up (net-tools) fails if routes_ has whitespace | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Andrew Maltsev <am> |
Component: | OpenRC | Assignee: | OpenRC Team <openrc> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | am |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=930f4021b1904b9c46c41c70b99d6e0620a1b59d | ||
Whiteboard: | openrc:oldnet | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 382299 | ||
Attachments: |
Crude patch using sed
Same sed based patch in unified format Config that does not work emerge --info, per request. |
Description
Andrew Maltsev
2011-05-10 01:19:20 UTC
Created attachment 272693 [details, diff]
Crude patch using sed
Not sure if it's a good idea to call an external process, but can't think of anything better right now. May be adding a "trim" command of some sort into runscript?
Comment on attachment 272693 [details, diff]
Crude patch using sed
This patch is not in a unified diff format, so I am unable to apply it.
Can you please re-post this in a unified diff format?
Created attachment 272993 [details, diff]
Same sed based patch in unified format
Patch reposted in unified format.
I can't reproduce your problem, works fine for me. Christian, did you test with the exact format I described (whitespace in front of "default via")? I still see the bug in openrc 0.8.3. It's minor, I agree, but it is easy to put a space in front of "default" by mistake which would show no error and would set up incorrect routes. The fix is trivial. I don't see any reason not to apply it. Yeah, I also tried it with spaces as well as tabs and also with space/tab at the end of the route. Looks good here. Can you please attach your conf.d/net, so that I can test it again? Created attachment 287049 [details]
Config that does not work
If I add an output below line 624 of /etc/init.d/net.lo then I get this on the attached config: * Caching service dependencies [ ok ] * Bringing up interface eth0 * 192.168.0.205/24 [ ok ] * Adding routes * default via 192.168.0.1 ... * <<<<-host default via 192.168.0.1>>>> Notice "-host" in the cmd? It should be "-net" if not for the whitespace. # /etc/conf.d/net modules="iproute2" config_eth0=" 192.168.1.200/24 " routes_eth0=" default via 192.168.1.160 " # /etc/init.d/net.eth0 restart * Bringing down interface eth0 * Bringing up interface eth0 * 192.168.1.200/24 ... [ ok ] * Adding routes * default via 192.168.1.160 ... [ ok ] # netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.160 0.0.0.0 UG 0 0 0 eth0 127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 Oh, btw. I use the latest git revision of openrc, so currently rc (OpenRC) 0.9.3git-645bbf (Gentoo Linux). iputils 20100418-r1 (Shouldn't matter but anyway..) I don't know about the git version, but the latest in portage (0.9.3-r1) still has this problem, I just checked. ...and looking at the git version (without actually installing it) I don't see it fixed there either. Can't reproduce it with 0.9.3-r1 either. Please also attach emerge --info. Created attachment 287059 [details]
emerge --info, per request.
Ok, this happens if you use net-tools instead of iproute2. (In reply to comment #14) > Ok, this happens if you use net-tools instead of iproute2. In that case, can we take a look at ifconfig.sh.Linux.in and see if we should fix something in there instead of in net.lo.in? No. The problem is determining the right parameters to call _add_route with, whichever module provides it. Iproute works because it ignores both -host and -net as the first parameter. This should be fixed by commit 930f402. You can apply the patch by: # wget 'http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=patch;h=930f4021b1904b9c46c41c70b99d6e0620a1b59d' -O /tmp/net.lo.patch # patch /etc/init.d/net.lo < /tmp/net.lo.patch |