From: David Daney <ddaney@avtrex.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: freek@macfreek.nl
Cc: pgf@foxharp.boston.ma.us
Subject: [PATCH] net: Broadcast ARP packets on link local addresses
Date: Fri, 31 Mar 2006 15:26:00 -0800 [thread overview]
Message-ID: <17453.47752.914390.692779@dl2.hq2.avtrex.com> (raw)
From: David Daney
Greetings,
When an internet host joins a network where there is no DHCP server,
it may auto-allocate an IP address by the method described in RFC
3927. There are several user space daemons available that implement
most of the protocol (zcip, busybox, ...). The kernel's APR driver
should function in the normal manner except that it is required to
broadcast all ARP packets that it originates in the link local address
space (169.254.0.0/16). RFC 3927 section 2.5 explains the requirement.
The current ARP code is non-compliant because it does not broadcast
some ARP packets as required by RFC 3927.
This patch to net/ipv4/arp.c checks the source address of all ARP
packets and if the fall in 169.254.0.0/16, they are broadcast instead
of unicast. I would like to thank Freek Dijkstra wrote the first
version of the patch. He was kind enough to sign off on it in his
(off-list) e-mail to me:
>David Daney wrote:
>
>
>> For the linux kernel the requirements for contributing are quite easy.
>> All people who wrote the patch simply affirm that they are have the
>> right to contribute and that they are doing so. See section 11 of
>> Documentation/SubmittingPatches in the kernel source tree.
>
>
> Just read. (a) and (d) apply (I wrote it, and I'm fine that you use it):
> Signed-off-by: Freek Dijkstra <freek@macfreek.nl>
>
.
.
.
>
> I hereby release the above patch in the public domain.
> (You may credit me or not, I don't think it's needed).
>
> Have fun.
> Freek
This patch is against 2.6.16.1
Signed-off-by: David Daney <ddaney@avtrex.com>
---
--- net/ipv4/arp.c.orig 2006-03-31 13:44:50.000000000 -0800
+++ net/ipv4/arp.c 2006-03-31 13:48:26.000000000 -0800
@@ -682,6 +682,7 @@ void arp_send(int type, int ptype, u32 d
unsigned char *target_hw)
{
struct sk_buff *skb;
+ int lla;
/*
* No arp on this interface.
@@ -690,8 +691,13 @@ void arp_send(int type, int ptype, u32 d
if (dev->flags&IFF_NOARP)
return;
+ /* If link local address (169.254.0.0/16) we must broadcast
+ * the ARP packet. See RFC 3927 section 2.5 for details.
+ */
+ lla = (dest_ip & htonl(0xFFFF0000UL)) == htonl(0xA9FE0000UL);
+
skb = arp_create(type, ptype, dest_ip, dev, src_ip,
- dest_hw, src_hw, target_hw);
+ lla ? NULL : dest_hw, src_hw, target_hw);
if (skb == NULL) {
return;
}
next reply other threads:[~2006-03-31 23:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-31 23:26 David Daney [this message]
2006-04-07 7:20 ` Anand Kumria
2006-04-07 13:37 ` jamal
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=17453.47752.914390.692779@dl2.hq2.avtrex.com \
--to=ddaney@avtrex.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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
all inboxes | Powered by JetHome®