Bug 5432 - udhcpc doesn't work right on aliased interface
Summary: udhcpc doesn't work right on aliased interface
Status: VERIFIED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.18.x
Hardware: Other Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-06 19:53 UTC by Mikhail Z
Modified: 2012-08-13 15:58 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Z 2012-08-06 19:53:40 UTC
When I try to use udhcpc on an aliased interface eth0:0, it works initially, but when half of the lease is up and it goes to renew, it fails.

Here's my output:
[root@ST600 /]# udhcpc -vvv -f -i eth0:0 -s /etc/udhcpc.script
Adapter index 3
MAC 24:db:ad:00:12:4b
udhcpc (v1.18.5) started
Executing /etc/udhcpc.script deconfig
 interface=eth0:0
Entering listen mode: raw
Opening raw socket on ifindex 3
Got raw socket fd 5
Attached filter to raw socket fd 5
Created raw socket
Adapter index 3
MAC 24:db:ad:00:12:4b
Adding option: 0x35 01
Adding option: 0x3d 0124dbad00124b
Adding option: 0x39 0240
Adding option: 0x3c 756468637020312e31382e35
Sending discover...
 hlen 6 xid 2aa73eb4 ciaddr 0 yiaddr 0 siaddr 0 giaddr 0
 chaddr 24dbad00124b00000000000000000000
Waiting on select...
Got valid DHCP packet
 hlen 6 xid 2aa73eb4 ciaddr 0 yiaddr a003633 siaddr a00360a giaddr 0
 chaddr 24dbad00124b00000000000000000000
Option found: 0x35 02
Option found: 0x36 0a00360a
Adapter index 3
MAC 24:db:ad:00:12:4b
Adding option: 0x35 03
Adding option: 0x3d 0124dbad00124b
Adding option: 0x32 0a003633
Adding option: 0x36 0a00360a
Adding option: 0x39 0240
Adding option: 0x3c 756468637020312e31382e35
Sending select for 10.0.54.51...
 hlen 6 xid 2aa73eb4 ciaddr 0 yiaddr 0 siaddr 0 giaddr 0
 chaddr 24dbad00124b00000000000000000000
Waiting on select...
Got valid DHCP packet
 hlen 6 xid 2aa73eb4 ciaddr 0 yiaddr a003633 siaddr a00360a giaddr 0
 chaddr 24dbad00124b00000000000000000000
Option found: 0x35 05
Option found: 0x33 0000012c
Lease of 10.0.54.51 obtained, lease time 300
Option found: 0x01 ffffffc0
Option 0x02 not found
Option found: 0x03 0a003601
Option found: 0x06 0a00034108080808
Option 0x09 not found
Option 0x0c not found
Option 0x0d not found
Option 0x0f not found
Option 0x10 not found
Option 0x11 not found
Option 0x17 not found
Option 0x1a not found
Option 0x1c not found
Option 0x21 not found
Option 0x28 not found
Option 0x29 not found
Option 0x2a not found
Option 0x2c not found
Option found: 0x33 0000012c
Option found: 0x36 0a00360a
Option 0x38 not found
Option 0x42 not found
Option 0x43 not found
Option 0x77 not found
Option 0x78 not found
Option 0x79 not found
Option 0xf9 not found
Option 0xfc not found
Option 0x32 not found
Option found: 0x35 05
Option 0x39 not found
Option 0x34 not found
Option found: 0x01 ffffffc0
Option 0x02 not found
Option found: 0x03 0a003601
Option found: 0x06 0a00034108080808
Option 0x09 not found
Option 0x0c not found
Option 0x0d not found
Option 0x0f not found
Option 0x10 not found
Option 0x11 not found
Option 0x17 not found
Option 0x1a not found
Option 0x1c not found
Option 0x21 not found
Option 0x28 not found
Option 0x29 not found
Option 0x2a not found
Option 0x2c not found
Option found: 0x33 0000012c
Option found: 0x36 0a00360a
Option 0x38 not found
Option 0x42 not found
Option 0x43 not found
Option 0x77 not found
Option 0x78 not found
Option 0x79 not found
Option 0xf9 not found
Option 0xfc not found
Executing /etc/udhcpc.script bound
deleting routers
adding dns 10.0.3.65
adding dns 8.8.8.8
 interface=eth0:0
 ip=10.0.54.51
 subnet=255.255.255.192
 mask=26
 router=10.0.54.1
 dns=10.0.3.65 8.8.8.8
 lease=300
 serverid=10.0.54.10
 siaddr=10.0.54.10
Entering listen mode: none
Waiting on select...

Adapter index 3
MAC 24:db:ad:00:12:4b
Entering listen mode: kernel
Opening listen socket on *:68 eth0:0
udhcpc: can't bind to interface eth0:0: No such device
[root@ST600 /]#


I saw a mention of this problem from long ago here: http://landley.net/mantis/mantis-1032.html but didn't see a resolution. 

Also saw a mention of it in "busybox-1.18.5/networking/udhcp/socket.c": 	
/* NB: bug 1032 says this doesn't work on ethernet aliases (ethN:M) */
Comment 1 Mikhail Z 2012-08-06 20:31:54 UTC
This is running on embedded Linux 2.6.31.12 on a powerpc arch (MPC8xx).

The failure seems to be in "setsockopt_bindtodevice()".
Comment 2 Denys Vlasenko 2012-08-09 22:29:34 UTC
Should be fixed by

http://git.busybox.net/busybox/commit/?id=6567edd10b0ebd3333f4283decd90e1d57a42885

Please reopen if it is not.
Comment 3 Mikhail Z 2012-08-13 15:58:01 UTC
The patch worked, thanks.