Netdev List
 help / color / mirror / Atom feed
From: "Dmitry Semyonov" <dmitry_sem@mail.ru>
To: <netdev@oss.sgi.com>
Subject: ethernet patch
Date: Tue, 2 Mar 2004 23:46:37 +0300	[thread overview]
Message-ID: <002701c40097$bcc3d970$0107a8c0@dmitry> (raw)

[-- Attachment #1: Type: text/plain, Size: 1802 bytes --]

Hello,
It seems there is a problem in the network layer of the 2.6.3 kernel. When
IFF_NOARP is enabled on the device, the first outgoing packet is getting
lost.

I tried the following configuration: two computers are connected with the
network cable. On both sides ARP is switched off on the network adapters,
and MAC addresses are configured manually using the arp utility. When I ping
one computer from another, I am getting ping replies only starting from the
third one. The reason is the following: network layer is caching hardware
(ethernet) headers. When I send a packet, this cache is examined for the
proper header. If it is not found, the arp table is examined too. The data
from the arp table is used for constructing the header for the packet
(eth_header() in eth.c) and creating a cache entry (eth_hard_header() in
eth.c). The cache entry is created correctly, but the header for outgoing
packet in case of IFF_NOARP switched on the device is filled with zero
destination address (MAC). So this packet is then lost. Next time the cache
entry is used, and the packets are send correctly. So when I am pinging one
computer from another the first ping request is lost so there is no answer
for it. The second ping request gets to the other computer, and it sends a
reply, wich is lost on the other side. And only for the third packet I get a
reply from the other computer.

This causes for example internet pages open very slowly on the links with
ARP turned off, because the first request is lost, and it takes a while when
the client resends it.

Please, include the attached patch in the kernel. It fixes this problem on
the 2.6.3 kernel. The same problem is in the 2.4.18 kernel. I verified it on
both 2.6.3 and 2.4.18 kernels and they work fine after the correction.

Thank you.

Dmitry

[-- Attachment #2: patch-2.6.3-ethernet --]
[-- Type: application/octet-stream, Size: 848 bytes --]

--- linux-2.6.3/net/ethernet/eth.c	2004-02-18 06:58:03.000000000 +0300
+++ linux-2.6.3-patched/net/ethernet/eth.c	2004-03-02 21:15:46.000000000 +0300
@@ -31,6 +31,7 @@
  *				  older network drivers and IFF_ALLMULTI.
  *	Christer Weinigel	: Better rebuild header message.
  *             Andrew Morton    : 26Feb01: kill ether_setup() - use netdev_boot_setup().
+ *             Dmitry Semenov   : 29Feb04: eth_header() - bug fix for IFF_NOARP devices
  *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
@@ -101,7 +102,7 @@
 	 *	Anyway, the loopback-device should never use this function... 
 	 */
 
-	if (dev->flags & (IFF_LOOPBACK|IFF_NOARP)) 
+	if (dev->flags & IFF_LOOPBACK) 
 	{
 		memset(eth->h_dest, 0, dev->addr_len);
 		return ETH_HLEN;

                 reply	other threads:[~2004-03-02 20:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='002701c40097$bcc3d970$0107a8c0@dmitry' \
    --to=dmitry_sem@mail.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