netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IFF_NOARP & broadcasting
@ 2002-07-24 16:04 Karlis Peisenieks
  2002-07-24 16:52 ` kuznet
  0 siblings, 1 reply; 6+ messages in thread
From: Karlis Peisenieks @ 2002-07-24 16:04 UTC (permalink / raw)
  To: netdev

Hello!

Is there any serious reason why when device has IFF_NOARP set, devices ll
address is used as destination address even for broadcasts (and even when
devices broadcast address is valid)? Currently it is impossible to send out
correct broadcast over ethernet when IFF_NOARP is set.

The code in question is in net/ipv4/arp.c, function arp_constructor:

                if (neigh->type == RTN_MULTICAST) {
                        neigh->nud_state = NUD_NOARP;
                        arp_mc_map(addr, neigh->ha, dev, 1);
                } else if (dev->flags&(IFF_NOARP|IFF_LOOPBACK)) {
                                       ^^^^^^^^^
                        neigh->nud_state = NUD_NOARP;
                        memcpy(neigh->ha, dev->dev_addr, dev->addr_len);
                } else if (neigh->type == RTN_BROADCAST ||
dev->flags&IFF_POINT neigh->nud_state = NUD_NOARP;
                        memcpy(neigh->ha, dev->broadcast, dev->addr_len);
                }

Is it ok to apply following patch and not break anything:

--- arp.c.orig	Wed Jul 24 19:02:53 2002
+++ arp.c	Wed Jul 24 19:01:06 2002
@@ -289,12 +289,15 @@
 		if (neigh->type == RTN_MULTICAST) {
 			neigh->nud_state = NUD_NOARP;
 			arp_mc_map(addr, neigh->ha, dev, 1);
-		} else if (dev->flags&(IFF_NOARP|IFF_LOOPBACK)) {
+		} else if (dev->flags&IFF_LOOPBACK) {
 			neigh->nud_state = NUD_NOARP;
 			memcpy(neigh->ha, dev->dev_addr, dev->addr_len);
 		} else if (neigh->type == RTN_BROADCAST ||
dev->flags&IFF_POINTOPOINT) {
 			neigh->nud_state = NUD_NOARP;
 			memcpy(neigh->ha, dev->broadcast, dev->addr_len);
+		} else if (dev->flags & IFF_NOARP) {
+			neigh->nud_state = NUD_NOARP;
+			memcpy(neigh->ha, dev->dev_addr, dev->addr_len);
 		}
 		if (dev->hard_header_cache)
 			neigh->ops = &arp_hh_ops;

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

end of thread, other threads:[~2002-07-25 14:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-24 16:04 IFF_NOARP & broadcasting Karlis Peisenieks
2002-07-24 16:52 ` kuznet
2002-07-24 18:06   ` Karlis Peisenieks
2002-07-25 13:32   ` IFF_NOARP & broadcasting [2] Karlis Peisenieks
2002-07-25 14:02     ` kuznet
2002-07-25 14:53       ` Karlis Peisenieks

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