From: Karlis Peisenieks <karlis@mt.lv>
To: netdev@oss.sgi.com
Subject: IFF_NOARP & broadcasting
Date: Wed, 24 Jul 2002 19:04:21 +0300 [thread overview]
Message-ID: <20020724190421.A2449@karlis> (raw)
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;
next reply other threads:[~2002-07-24 16:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-24 16:04 Karlis Peisenieks [this message]
2002-07-24 16:52 ` IFF_NOARP & broadcasting 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
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=20020724190421.A2449@karlis \
--to=karlis@mt.lv \
--cc=netdev@oss.sgi.com \
/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).