Re: OpenTransport behaviour under X
Re: OpenTransport behaviour under X
- Subject: Re: OpenTransport behaviour under X
- From: "Justin C. Walker" <email@hidden>
- Date: Thu, 30 Oct 2003 17:06:24 -0800
On Thursday, October 30, 2003, at 03:51 PM, Marc Stibane wrote:
Well, my code did also send out packets to 255.255.255.255. But the
server on the other end didn't think it should accept the packets,
since
the Ethernet Address in the packet header wasn't set to the correct
local
subnet broadcast address. Funny, OT on 9 native and on Classic do set
this automagically.
I'm curious about this. There is no "local subnet broadcast address"
in the Ethernet spec. There is broadcast and multicast. Both the
broadcast IP address and the subnet broadcast IP address should
translate to the ethernet broadcast address. Can you be more specific
about the reason the remote host ignored/rejected the packet?
Thanks for clarifying.
the code looks like this:
[snip]
and then opens an endpoint, binds it to "host" and sends the packet to
"server". The packet data looks similar under 9 and under X, but in the
packet header 9 replaces the broadcast address INADDR_BROADCAST
(255.255.255.255) with the local subnet broadcast address, while X
doesn't change it.
The issue isn't directly related to "the ethernet address" (which is
what got me curious).
This may be an OT vs. BSD thing. In my quick tests, the Darwin stack
accepts either form (limited (all-ones) or subnet broadcast address)
and sends it as is. You have to condition the socket by setting a
socket option with either SO_BROADCAST (at the SOL_SOCKET layer) or
IP_ALLOWBROADCAST (in the IPPROTO_IP layer). The OT support on Mac OS
X does this gratis.
When I did this myself by changing the last line of code to read:
server.sin_addr.s_addr = OTInetInfo.fBroadcastAddr;
then the packet header carries my local subnet broadcast address
192.168.102.255 and now the RIP will accept the packet (and answer it).
It's possible that "the RIP" (your server?) won't accept the limited
broadcast; only the subnet broadcast.
Regards,
Justin
Marc Stibane
Fesh! email@hidden
Kurf|rstenstr. 154 tel +49-30-3990 2690
10785 Berlin, Germany mobil +49-173-6522 422
In a world without walls and fences,
who needs windows and gates?
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | Men are from Earth.
| Women are from Earth.
| Deal with it.
*--------------------------------------*-------------------------------*
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.