Re: Porting Winsock DHCP Server; is OS/X ignoring Broadcast UDP in recvall()?
Re: Porting Winsock DHCP Server; is OS/X ignoring Broadcast UDP in recvall()?
- Subject: Re: Porting Winsock DHCP Server; is OS/X ignoring Broadcast UDP in recvall()?
- From: Peter Sichel <email@hidden>
- Date: Wed, 30 Jan 2008 09:34:24 -0500
On Jan 30, 2008, at 2:57 AM, Hostile Fork wrote:
I am porting a WinSock DHCP-like server to OS/X, and have run into a
wall.
I've written a Mac OS X DHCP Server that has been shipping for some
time.
After using packet sniffers I've found a smoking gun that OS/X may
be ignoring broadcast UDP packets that are sent from the serviced
network to 255.255.255.255 to the serviced port #8567. (FYI: This
machine has two network cards, and the devices that are making DHCP
requests are connected on a network through the second card which
has a static IP address... the first card is used for plain ol'
internet access.) It's a little complicated, but I'll point out
that send()s to that static IP subnet are seeming to work and get a
reaction, so the connection is at least somewhat "alive".
I vaguely recall running into some issues in the BSD stack around
which network interface(s) will receive broadcast packets that caused
me to use libpcap to receive the packets at the data link layer.
Compared to other network stacks (like Mentat/TCP) which just work,
broadcast is kind of broken in the BSD stack. It's common practice to
use libpcap for receive and bpftransmit for send when implementing
DHCP servers or clients.
As I remember, in Mentat/TCP broadcast packets were always duplicated
and sent upstream or downstream to every broadcast enabled interface.
In BSD, the packet is not automatically duplicated. The first
broadcast enabled interface receives inbound broadcasts, and sending
requires that you use the subnet broadcast address to determine which
interface will transmit the packet. The critical flaw in this is that
computers with one or more dynamically configured interfaces have
become so common that the behavior is unpredictable in the field.
Kind Regards,
- Peter Sichel
Sustainable Softworks
http://www.sustworks.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden