proposed patch for supporting alias interfaces on linux systems

Miguel Telleria de Esteban miguel at
Fri Sep 25 08:44:34 UTC 2009

Dear all,


For my personal needs I would like to set a DHCP server (3.3.2p1) to
answer from a virtual interface (eth0:1). 

Trying to do this I stumbled with the same problem that has been
previously reported here:

  i.e. when launching the server with:

	/usr/sbin/dhcp3d eth0:1

  I obtain the message:

      No subnet declaration for eth0:1


1.  First approach

Digging inside the source code with gdb shows that the function


    within discover.c, trunks every aliased interface name

    "eth0:1" --> becomes "eth0"

    at the discovering stage.

More precisely, this happens when the ALIAS_NAMES_PERMUTTED is defined
(which happens on my linux system since includes/cf/linux has it

2.  Second approach  (ROOT OF THE PROBLEM)

To find the rationale of the defined I disabled it and forced the
complete name "eth0:1" to be passed to the socket functions bind() and
sendto() inside lpf.c. 

This produces an error because the linux kernel does not seem to accept
binding a socket of type SOCKET_PACKET (PF_PACKET family) to a virtual


I propose to maintain the name truncation but only at the lowest layer
of ISC DHCP libs, that is the lpf.c socket calls.

What my attached patch does is perform the "eth0:1"-->"eth0" truncation
directly on the sockaddr_t sa.sa_data field.

Therefore the SOCKET_PACKET will be opened for the real interface
("eth0") but the IP header data (origin IP address, etc) will be taken
from the "eth0:1" information structure.

I have tested it for my simple needs and it seems to work.


*  Does my solution create a security flaw somehow?  what would be the
   implications for other features of ISC DHCP?

*  Would you accept the patch for future releases (also the dhcp-4
   branch if applicable)?

*  Is there a bug tracking system where this error could be posted.

Kind regards,

	Miguel Telleria


 Email: miguel at           Tel GSM:  +34 650 801098
                                          Tel Fix:  +34 942 280174

 Miembro de    Membre du
 ¿Usuario captivo o libre?
 Free or  captive user?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: alias_interfaces_from_discover_to_lpf.patch
Type: text/x-patch
Size: 2161 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the dhcp-users mailing list