linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Broadcast ARP packets on link local addresses (Version2).
@ 2006-04-05 21:22 David Daney
  2006-04-06 10:24 ` Janos Farkas
  2006-04-22 17:14 ` [PATCH] net: " Anand Kumria
  0 siblings, 2 replies; 8+ messages in thread
From: David Daney @ 2006-04-05 21:22 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, pgf, freek

From: David Daney

Here is a new version of the patch I sent March 31.  For background,
this is my description from the first patch:

> 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.

All of that is still true.

The changes in this version are that it tests the source IP address
instead of the destination.  The test now matches the test described
in the RFC.  Also a small cleanup as suggested by Herbert Xu.

Some comments on the first version of the patch suggested that I do
'X' instead.  Where 'X' was behavior different than that REQUIRED by
the RFC (the RFC's always seem to capitalize the word 'required').

The reason that I implemented the behavior required by the RFC is so
that a device running the kernel can pass compliance tests that
mandate RFC compliance.

If the patch is deemed good and correct, great, please apply it.

Othwise comments about how to improve it are always welcome.  But keep
in mind that I would like to end up with something that complies with
the RFC.

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-04-05 13:33:19.000000000 -0700
@@ -690,6 +690,11 @@ 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. */
+	if ((src_ip & htonl(0xFFFF0000UL)) == htonl(0xA9FE0000UL))
+		dest_hw = NULL;
+
 	skb = arp_create(type, ptype, dest_ip, dev, src_ip,
 			 dest_hw, src_hw, target_hw);
 	if (skb == NULL) {

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-04-22 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-05 21:22 [PATCH] net: Broadcast ARP packets on link local addresses (Version2) David Daney
2006-04-06 10:24 ` Janos Farkas
2006-04-06 16:17   ` David Daney
2006-04-06 16:53     ` Janos Farkas
2006-04-07 13:30     ` jamal
2006-04-07 16:18       ` David Daney
2006-04-07 20:38         ` Mark Butler
2006-04-22 17:14 ` [PATCH] net: " Anand Kumria

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).