Re: ARP cache entry for router
Re: ARP cache entry for router
- Subject: Re: ARP cache entry for router
- From: Ryan McGann <email@hidden>
- Date: Fri, 7 Nov 2003 00:35:49 -0800
On Nov 6, 2003, at 11:42 PM, Ryan McGann wrote:
Should I go to the trouble of crafting an ARP packet and waiting for
the
reply, or is it a "99% safe" assumption that the ARP entry will exist
(assuming the router information is correct in the user's settings)?
Do you really need to send an ARP packet to get the router entered
into the
the ARP table? Might it be sufficient to attempt to send an IP packet
to
the router, with the result that the OS adds the router to the ARP
table as
part of addressing the IP packet?
That's actually how I've implemented it. I was just hoping it would be
unecessary.
I would think waiting for a reply is unnecessary.
Waiting is unecessary, though I had to put an arbitrary sleep in there
to make sure that the kernel had enough time to get the packet and
cache the response.
I asked because doing the same thing for IPv6 isn't quite as simple,
and I was hoping that maybe it would be unecessary. I already have the
IPv4 ARP code done, but the neighbor discovery code for IPv6 doesn't
seem to work....so my next question is:
I'm trying to send a router solicitation packet for IPv6 router
discovery, in case the router isn't in the neighbor cache. However, it
seems that my sendto call always returns -1 with errno set to 22
(illegal parameter). Here's the code below. Does anybody see anything
wrong off the top of their head? I'm pretty new to IPv6, so I'm
probably just missing something obvious.
Actually I found my mistake right after I sent this message...after
copying and pasting the code into the email I realized I was missing
the cmsghdr structure. Thanks anyway!
Ryan
Arguing with an engineer is like wrestling with a pig in mud.
After a while, you realize the pig is enjoying 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.