LTSP clients doesn't sets up their broadcast addresses during bootup (patch provided which fixes the issue)

Bug #604276 reported by Ricardo Pérez López
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ltsp (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: ltsp-client-core

My LTSP installation works great except for this issue: the LTSP clients got 0.0.0.0 broadcast address from the server after booting.

Steps to reproduce:

1. Unlock the chroot root account following this howto: https://help.ubuntu.com/community/UbuntuLTSP/UnlockChrootRootAcct
2. Boot an LTSP client.
3. When LDM is displayed, press Ctrl-Alt-F1 to go to a text console.
4. Login as root.
5. Type "ifconfig".

Result:

All the IP parameters has been correctly set up from the DHCP server, except for the broadcast address, which has been set as 0.0.0.0:

root@p8pc1:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:d6:3b:40
        inet addr:192.168.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
        inet6 addr:fe80::a00:27ff:fed6:3b40/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets: 79891 errors:0 dropped:0 overruns:0 frame:0
        TX packets: 14726 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:120036016 (120.0 MB) TX bytes:1055693 (1.0 MB)

If I then do a "udhcpc eth0" to get a new DHCP lease, I get:

root@p8pc1:~# udhcpc eth0
udhcpc (v0.9.9-pre) started
Sending discover...
Sending select for 192.168.0.2...
Lease of 192.168.0.2 obtained, lease time 43200
Resetting default routes
adding dns 192.168.0.1

and now I have all the IP params perfectly setup, including the broadcast address:

root@p8pc1:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:d6:3b:40
        inet addr:192.168.0.2 Bcast:192.168.255.255 Mask:255.255.0.0
        inet6 addr:fe80::a00:27ff:fed6:3b40/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets: 81418 errors:0 dropped:0 overruns:0 frame:0
        TX packets: 15092 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:122309092 (122.3 MB) TX bytes:1086942 (1.0 MB)

So obviously this is not a problem on the dhcpd configuration in the LTSP server.

Revision history for this message
Ricardo Pérez López (ricardo) wrote :
Revision history for this message
Ricardo Pérez López (ricardo) wrote :

I have a workaround which involves hacking of the /opt/ltsp/i386/usr/share/initramfs-tools/scripts/init-premount/udhcp:

1. Enter chroot.
2. # vi /usr/share/initramfs-tools/scripts/init-premount/udhcp
    and comment the line 151 which says "chmod +x /tmp/dhcp-script.sh".
3. # update-initramfs -u
4. Exit chroot.
5. sudo ltsp-update-kernels
6. sudo ltsp-update-image

Since then, my LTSP clients has their correct address broadcast.

However, there's one problem with this workaround: the DNS address is not correctly set up. Any clues?

Revision history for this message
Ricardo Pérez López (ricardo) wrote :

OK, I found where the problem is.

Looking at /opt/ltsp/i386/usr/share/initramfs-tools/scripts/init-premount/udhcp, line 223, you see:

  ip address add $ip/$(subnet_to_cidr $subnet) dev $interface

The above line is the command which effectively sets up the IP parameters of the network interface. However, it doesn't sets the broadcast address.

The best solution is to change the above line with the following:

  [ -n "$broadcast" ] && IP_BROADCAST="broadcast $broadcast"
  ip address add $ip/$(subnet_to_cidr $subnet) $IP_BROADCAST dev $interface

After doing update-initramfs, ltsp-update-kernels and ltsp-update-image, LTSP clients get their broadcast address perfectly well.

Revision history for this message
Ricardo Pérez López (ricardo) wrote :

This is a patch against /opt/ltsp/i386/usr/share/initramfs-tools/scripts/init-premount/udhcp which solves the issue without side effects. Could any LTSP developer take a look at it to see if it's OK to include it in the next version? Thanks!

summary: - LTSP clients got 0.0.0.0 broadcast address from the server after booting
+ LTSP clients doesn't sets up their broadcast addresses during bootup
+ (patch provided which fixes the issue)
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Looks good to me, thank you Ricardo, nice catch.

Committed a slightly modified version in http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/1759.

Changed in ltsp (Ubuntu):
status: New → Fix Committed
tags: added: patch
Adam Guthrie (therigu)
tags: added: patch-accepted-upstream
Changed in ltsp (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.