From: Karlis Peisenieks <karlis@mt.lv>
To: kuznet@ms2.inr.ac.ru
Cc: netdev@oss.sgi.com
Subject: Re: IFF_NOARP & broadcasting [2]
Date: Thu, 25 Jul 2002 17:53:10 +0300 [thread overview]
Message-ID: <20020725175310.A13694@karlis> (raw)
In-Reply-To: <200207251402.SAA02033@sex.inr.ac.ru>; from kuznet@ms2.inr.ac.ru on Thu, Jul 25, 2002 at 17:02:18 +0300
On 2002.07.25 17:02 kuznet@ms2.inr.ac.ru wrote:
> You have just made great discovery. :-)
>
> It was big puzzle why people blame that they see packets with zero MAC,
> sometimes. Apparently, this happens on the first packet, when hh cache
> is still not created. :-)
Yes, this was killing me too.
> I am not sure that this is right. Protocols using neighbour cache
> will work, but anothers will fail on NOARP devices.
>
> It is safer just to reorder two ifs, checking for daddr!=NULL first.
You mean like this:
--- eth.c.orig Thu Jul 25 17:50:20 2002
+++ eth.c Thu Jul 25 17:50:35 2002
@@ -96,6 +96,12 @@
else
memcpy(eth->h_source,dev->dev_addr,dev->addr_len);
+ if(daddr)
+ {
+ memcpy(eth->h_dest,daddr,dev->addr_len);
+ return dev->hard_header_len;
+ }
+
/*
* Anyway, the loopback-device should never use this
function...
*/
@@ -106,12 +112,6 @@
return(dev->hard_header_len);
}
- if(daddr)
- {
- memcpy(eth->h_dest,daddr,dev->addr_len);
- return dev->hard_header_len;
- }
-
return -dev->hard_header_len;
}
Karlis
prev parent reply other threads:[~2002-07-25 14:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=20020725175310.A13694@karlis \
--to=karlis@mt.lv \
--cc=kuznet@ms2.inr.ac.ru \
--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).