FS#13237 - Copying manual network configuration to rc.conf
Attached to Project:
Release Engineering
Opened by Alexander De Sousa (Aphanic) - Thursday, 12 February 2009, 10:05 GMT
Last edited by Gerhard Brauer (GerBra) - Thursday, 30 July 2009, 06:17 GMT
Opened by Alexander De Sousa (Aphanic) - Thursday, 12 February 2009, 10:05 GMT
Last edited by Gerhard Brauer (GerBra) - Thursday, 30 July 2009, 06:17 GMT
|
Details
If you choose to configure network manually (by entering IP,
net mask, broadcast IP, ...) and then you choose to use that
settings in the installed system, the setup script may not
update correctly the broadcast IP and even giving an invalid
one.
To reproduce this bug just use any IP with at least one of the bytes different from the default one (e.g. 192.168.8.2, which would give an incorrect broadcast IP) or with more than 8 digits (e.g. 192.168.0.27, would give an invalid broadcast IP). The attached patch fixes it. |
This task depends upon
And when all values for your network are correct in network setup dialog then these values are also correct in generated rc.conf.
I've made all my tests with an 10.0.0.X IP and settings and see never a problem.
In line 884 of the setup script there is: sed -i "s#192.168.0.2# $IPADDR#g" ${DESTDIR}/etc/rc.conf
Which means that it will replace 192.168.0.2 by the IP address you choose. The problem is that the line 62 in the default rc.conf is:
eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
So if you choosed 192.168.0.27 (for example) it will end up looking like this:
eth0="eth0 192.168.0.27 netmask 255.255.255.0 broadcast 192.168.0.2755"
If you take a look at the broadcast IP it is clearly invalid.
- the sed for the ip does a global replace and since the broadcast contains the ip-string it will also replace there, updating the broadcast in rc.conf to something incorrect
- the sed that should fix the broadcast cannot find what it's looking for, because the previous thing.
your solution fixes both and looks good to me. let's use it for the next release
I left in case it could appear more times because it was already there.
Anyway I've taken a look to the code in AIF (lib-network.sh) and it should work, I can't see anything wrong there. The code already worked with the old installer and in AIF it is essentially the same.
Regards.
Tested with IP 192.168.xxx.201, broadcast was correctly set. All values during manual network config are correctly parsed to generated rc.conf.