[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#308964: Preseeding .1 host IP bug



Package: installation-reports

INSTALL REPORT

Debian-installer-version: RC3 boot.img.gz, 20050505 sarge-i386-netinst.iso
uname -a: N/A
Date: 13th May 2005
Method: hd-media install + preseed file.
Machine: N/A
Processor: N/A
Memory: N/A
Root Device: N/A
Root Size/partition table: N/A
Output of lspci and lspci -n: N/A

Base System Installation Checklist:
[O] = OK, [E] = Error (please elaborate below), [ ] = didn't try it

Initial boot worked:    [0]
Configure network HW:   [0]
Config network:         [E]
Detect CD:              [ ]
Load installer modules: [ ]
Detect hard drives:     [ ]
Partition hard drives:  [ ]
Create file systems:    [ ]
Mount partitions:       [ ]
Install base system:    [ ]
Install boot loader:    [ ]
Reboot:                 [ ]

Comments/Problems:

There is a bug in the installer (netcfg?) that gives a Red Screen of Death 
(RSoD) if you preseed with a host IP address of x.x.x.1.
If you manually enter one, instead of preseeding, the installer works fine.

RSoD is:
[!!] Configure the network
Malformed IP address
The IP address you provided is malformed. It should be in the form
x.x.x.x where each 'x' is no larger than 255. Please try again.

<Continue>

However, pressing enter just gives you the same screen straight back, you can 
not proceed through the installer.

Example preseed that is successful (taken from example-preseed.txt):

d-i netcfg/disable_dhcp                boolean true
d-i netcfg/get_nameservers             string 192.168.1.1
d-i netcfg/get_ipaddress               string 192.168.1.42
d-i netcfg/get_netmask                 string 255.255.255.0
d-i netcfg/get_gateway                 string 192.168.1.1

Example preseed that fails (swapped gateway/nameserver IP and host IP):

d-i netcfg/disable_dhcp                boolean true
d-i netcfg/get_nameservers             string 192.168.1.42
d-i netcfg/get_ipaddress               string 192.168.1.1
d-i netcfg/get_netmask                 string 255.255.255.0
d-i netcfg/get_gateway                 string 192.168.1.42

If you manually enter a host IP address of 192.168.1.42 then the installer 
pre-fills the gateway with 192.168.1.1, which you can then edit if you wish or 
just accept it.

If you manually enter a host IP address of 192.168.1.1 then the installer 
pre-fills the gateway with 192.168.1., which you then need to edit as that 
isn't a valid IP.

This pre-filling of the gateway with x.x.x.1 is where I think the problem comes
from.  Here is what I think is the relevant code, in packages/netcfg/static.c:

    if (ipaddress.s_addr != old_ipaddress.s_addr ||
        netmask.s_addr != old_netmask.s_addr)
    {
      network.s_addr = ipaddress.s_addr & netmask.s_addr;
      broadcast.s_addr = (network.s_addr | ~netmask.s_addr);

      /* Preseed gateway */
      gateway.s_addr = ipaddress.s_addr & netmask.s_addr;
      gateway.s_addr |= htonl(1);
    }

    inet_ntop (AF_INET, &gateway, ptr1, sizeof (ptr1));

    /* if you entered a .1 ip, you'll get a .1 back, so makes sense
     * to clear the last bit */
    if (gateway.s_addr == ipaddress.s_addr)
    {
      char* ptr = strrchr(ptr1, '.');
      assert (ptr); /* if there's no dot in ptr1 we're in deep shit */
      ptr[1] = '\0';
    }

Mike.





Reply to: