linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Steven Scholz <steven.scholz@imc-berlin.de>
To: Dan Malek <dan@embeddededge.com>
Cc: LinuxPPC <linuxppc-embedded@lists.linuxppc.org>,
	Brad Parker <brad@parker.boston.ma.us>
Subject: Re: Questions about ARP
Date: Tue, 12 Aug 2003 14:34:12 +0200	[thread overview]
Message-ID: <3F38DEC4.8050708@imc-berlin.de> (raw)
In-Reply-To: <3F33EADE.4010908@embeddededge.com>

[-- Attachment #1: Type: text/plain, Size: 1686 bytes --]

Dan Malek wrote:

 > Steven Scholz wrote:
 >
 >> But when I connect my MPC8xx board with Linux it seems that Linux is
 >> not responding to the ARP requests done by the Windows machine.
 >> Result: Both machine end up with the same IP address.
 >
 >
 > Fortunately, Linux isn't Windows......you are going to find lots of
 > Windows "standard" protocols that aren't documented nor supported by
 > anyone else.
 >
 >> Did I miss something?
 >
 >
 > Well, Microsoft did.....there is RFC2131 that describes how you are
 > supposed to use an ARP to respond to a duplicate IPv4 used on the
 > network.  It is commonly used to ensure you don't have systems
 > manually configured or not honoring leases when DHCP is handing out
 > dynamic IP addresses.  Everyone else seems to implement this properly.

Finaly I found the point you're talking about.
Linux is answering the ARP packets with Source Address 0.0.0.0 (see net/ipv4/arp.c):

         /* Special case: IPv4 duplicate address detection packet (RFC2131) */
         if (sip == 0) {
                 if (arp->ar_op == htons(ARPOP_REQUEST) &&
                     inet_addr_type(tip) == RTN_LOCAL)
                         arp_send(ARPOP_REPLY,ETH_P_ARP,tip,dev,tip,sha,dev->dev_addr,dev->dev_addr);
                 goto out;
         }

Windows is checking for duplicate addresses using ARP packets with source _and_
destination address set to the address in question. So of course Linux won't answer it!

But I can't find a single word in the RFC2131 (http://www.faqs.org/rfcs/rfc2131.html)
saying that the Source Address _must_ set to 0.0.0.0!!!!

So the attached patch will make M$ Windows happy and APIPA working.

Thanks,

Steven

[-- Attachment #2: linux-2.4.20-APAPI.patch --]
[-- Type: text/plain, Size: 730 bytes --]

+ diff -u ./net/ipv4/arp.c.APAPI ./net/ipv4/arp.c
--- ./net/ipv4/arp.c.APAPI	Tue Aug 12 13:00:59 2003
+++ ./net/ipv4/arp.c	Tue Aug 12 14:32:40 2003
@@ -760,6 +760,18 @@
 		goto out;
 	}

+#define MAKE_MS_WINDOWS_HAPPY
+#ifdef MAKE_MS_WINDOWS_HAPPY
+	/* Special case: IPv4 duplicate address detection packet (MS Windows) */
+	if (inet_addr_type(sip) == RTN_LOCAL) {
+		printk("ARP: IPv4 duplicate address detection packet (MS Windows)\n");
+		if (arp->ar_op == htons(ARPOP_REQUEST) &&
+		    inet_addr_type(tip) == RTN_LOCAL)
+			arp_send(ARPOP_REPLY,ETH_P_ARP,tip,dev,tip,sha,dev->dev_addr,dev->dev_addr);
+		goto out;
+	}
+#endif
+
 	if (arp->ar_op == htons(ARPOP_REQUEST) &&
 	    ip_route_input(skb, tip, sip, 0, dev) == 0) {


  reply	other threads:[~2003-08-12 12:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-08 15:04 Questions about ARP Steven Scholz
2003-08-08 18:24 ` Dan Malek
2003-08-12 12:34   ` Steven Scholz [this message]
2003-08-12 13:56     ` Build issues with 2.6.0-test3 Gary Thomas
2003-08-12 15:25       ` Tom Rini
2003-08-12 15:39         ` Matt Porter
2003-08-12 15:40         ` Gary Thomas
2003-08-12 15:46           ` Tom Rini
2003-08-12 19:13             ` Gary Thomas
2003-08-12 21:54               ` Tom Rini
2003-08-12 23:09                 ` Thomas Gleixner
2003-08-12 22:23                   ` Tom Rini
2003-08-12 15:39     ` Questions about ARP Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2003-08-12 14:05 Dave Ellis
2003-08-12 15:40 ` Dan Malek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F38DEC4.8050708@imc-berlin.de \
    --to=steven.scholz@imc-berlin.de \
    --cc=brad@parker.boston.ma.us \
    --cc=dan@embeddededge.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).