Re: Why no printk for duplicate IPs?

B. James Phillippe (bryan@terran.org)
Thu, 30 Sep 1999 12:49:57 -0700 (PDT)


On Thu, 30 Sep 1999, David Lang wrote:

> OK, I am misunderstanding what a gratuitus arp is supposed to do. I
> understood that is was sending an arp RESPONSE for your address not an arp
> REQUEST for your address. Sending a request for your address that you will
> be responding to will only do some good if you have a machine set to

It is an ARP request, there will never be a response (in normal operation;
a response would indicate somebody else on the LAN has your chosen IP).

All ARP requests are broadcast because you don't know who you're talking to
yet (hardware address, I mean). ARP responses are not broadcast; there is
no need for a response to be broadcast when both the source and dest MAC
address are now known, and only one host is asking anyway.

Intelligent IP stacks take note of ARP requests where the source and target
protocol address (IP address) are the same, and they will drop any existing
ARP entry they have for that IP/MAC pair and replace it with the hardware
address shown in the gratuitous ARP request.

I think there is a section in "TCP/IP Illustrated" describing this. Also
there is a tacky demo program that does it in user-space at
http://www.terran.org/~bryan/prog/files/garp.c. It is a tad dirty and
needs some updating, but it demonstrates how the packet should look.

-bp

--
# bryan at terran dot org
# http://www.terran.org/~bryan

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/