[PATCH] dhcprelay

Jesse Dutton jessedutton at gmail.com
Fri Sep 22 19:48:17 UTC 2006


Here is an updated patch without the duplicate select.

On 9/22/06, walter harms <wharms at bfs.de> wrote:
> do you realy need to set fds[] every time in the loop ?
In practice, I'm not sure what select() actually does to the fd_sets,
but in theory its supposed to be allowed to twiddle the bits as it
likes. These fd_sets are 128 byte structures in both glibc and uclibc.
I could add another one and memcpy, I suppose. However, in the most
common use case there will only be two items in the set, so the speed
benefit is questionable, and the size hit made me choose this way.
Still, I'm happy to change it if I'm missing something fundamental.

You asked me privately to explain to the group why this applet is
useful. This applet relays dhcp requests from one network interface to
another. Normally, dhcp is not a route-able protocol since it relies
on the broadcast MAC address and invalid IP addresses to obtain an IP
address without colliding with other valid network traffic. This
applet listens on one or more network interfaces for dhcp requests,
wraps them in a valid ip packet, queries the real dhcp server, and
relays replies. In essence, it routes dhcp.

Jesse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dhcprelay.patch2
Type: application/octet-stream
Size: 12640 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060922/2a7640b6/attachment-0002.obj 


More information about the busybox mailing list