netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC patch net-next] ipv4: use bcast as dst address in case IFF_NOARP is set
@ 2013-01-08 13:02 Jiri Pirko
  2013-01-08 17:11 ` Stephen Hemminger
  2013-01-08 22:27 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Jiri Pirko @ 2013-01-08 13:02 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, shemminger, kuznet, jmorris, yoshfuji, kaber

When IFF_NOARP is set on a device, dev->dev_addr is used as *dst*
addr of sent frames. That does not make sense. Use rather bcast address
instead.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/ipv4/arp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 9547a273..19d5ac2 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -290,11 +290,11 @@ static int arp_constructor(struct neighbour *neigh)
 		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)) {
+			   (dev->flags & (IFF_POINTOPOINT | IFF_NOARP))) {
 			neigh->nud_state = NUD_NOARP;
 			memcpy(neigh->ha, dev->broadcast, dev->addr_len);
 		}
-- 
1.8.1

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

end of thread, other threads:[~2013-01-08 22:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-08 13:02 [RFC patch net-next] ipv4: use bcast as dst address in case IFF_NOARP is set Jiri Pirko
2013-01-08 17:11 ` Stephen Hemminger
2013-01-08 17:45   ` Jiri Pirko
2013-01-08 19:10     ` Stephen Hemminger
2013-01-08 21:51       ` Jan Engelhardt
2013-01-08 22:33     ` David Miller
2013-01-08 22:27 ` David Miller

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