--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: udhcpd: udhpcd does not bind to the correct interface
- From: Fabrice LORRAIN <Fabrice.Lorrain@univ-mlv.fr>
- Date: Mon, 16 Aug 2010 10:49:30 +0200
- Message-id: <20100816084930.3612.85367.reportbug@caladan.univ-mlv.fr>
Package: udhcpd
Version: 0.9.8cvs20050303-2.1
Severity: normal
Hello,
Using udhcpd on a multihomed server, it seems not to use the "interface" directive
in udhcpd.conf.
Booth using a vlan syntaxe :
interface eth1.1
or a physical interface :
interface eth2
result in udhcpd binding/listening to all the interface :
$ sudo netstat -natup | grep udh
udp 0 0 0.0.0.0:67 0.0.0.0:* 22746/udhcpd
and distributing the lease in the wrong network through eth0.
Thanks.
@+,
Fab
-- System Information:
Debian Release: 5.0.5
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-2-686-bigmem (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages udhcpd depends on:
ii libc6 2.7-18lenny4 GNU C Library: Shared libraries
udhcpd recommends no packages.
udhcpd suggests no packages.
--- End Message ---
--- Begin Message ---
- To: 593205-done@bugs.debian.org
- Cc: Fabrice LORRAIN <Fabrice.Lorrain@univ-mlv.fr>
- Subject: Re: Bug#593205: udhcpd: udhpcd does not bind to the correct interface
- From: Michael Tokarev <mjt@tls.msk.ru>
- Date: Fri, 29 Apr 2011 22:48:27 +0400
- Message-id: <4DBB07FB.1070502@msgid.tls.msk.ru>
- In-reply-to: <AANLkTimY5iyocp5FBGD=LN_Jhx002XvvT7eGCSYmy_U5@mail.gmail.com>
- References: <20100816084930.3612.85367.reportbug@caladan.univ-mlv.fr> <AANLkTimY5iyocp5FBGD=LN_Jhx002XvvT7eGCSYmy_U5@mail.gmail.com>
Version: 0.9.8cvs20050303-2.1
27.08.2010 04:25, Otavio Salvador wrote:
> Hello Fabrice,
>
> On Mon, Aug 16, 2010 at 5:49 AM, Fabrice LORRAIN
> <Fabrice.Lorrain@univ-mlv.fr> wrote:
>> Package: udhcpd
>> Version: 0.9.8cvs20050303-2.1
>> Severity: normal
>>
>> Hello,
>>
>> Using udhcpd on a multihomed server, it seems not to use the "interface" directive
>> in udhcpd.conf.
[udp 0 0 0.0.0.0:67 0.0.0.0:* 22746/udhcpd]
This is how dhcpd works. It must bind to all-zeros in order to
be able to receive all-broadcast requests sent from zero IP.
If an interface is given it uses SO_BINDTODEVICE socket option
to only receive traffic from a given network device, like this
(from strace):
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_BINDTODEVICE, "if-onlime\0\0\0\0\0\0\0\4\0\0\0\2\0\0\0\21\0\0\0\35\360\4\10", 32) = 0
bind(5, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
(I told it to bind to if-onlime interface). So it all works
as expected.
> This version is quite old; please test the one in squeeze since it is
> up-to-date.
And it works as expected in both older version and the new
busybox-based version too. So closing this bug now.
Thanks!
/mjt
--- End Message ---