This drove me nuts this morning and i find it hard to believe that
no-one has reported this before because i went back as far back
as 2.4.2 and it is there ;->. I am ccing the three people who may
possibly have made this change (no records whatsoever in git);->

When you turn off ARP on a netdevice then the first packet always
goes out with a dstMAC of all zeroes. This is because the first
packet is used to resolve ARP entries. Even though the ARP entry may
be resolved (I tried by setting a static ARP entry for a host i was
pinging from), it gets overwritten by virtue of having the netdevice
disabling ARP.
Subsequent packets go out fine with correct dstMAC address (which may be
why people have ignored reporting this issue).

To cut the story short: 
the culprit code is in net/ethernet/eth.c::eth_header()

----
        /*
         *      Anyway, the loopback-device should never use this
function...
         */

        if (dev->flags & (IFF_LOOPBACK|IFF_NOARP))
        {
                memset(eth->h_dest, 0, dev->addr_len);
                return ETH_HLEN;
        }

        if(daddr)
        {
                memcpy(eth->h_dest,daddr,dev->addr_len);
                return ETH_HLEN;
        }

----

Note how the h_dest is being reset when device has IFF_NOARP.

The only reason i am asking is that this small piece of code has
some huge impact and i dont understand the history of IFF_NOARP check
being put there.

As a note:
All devices including loopback pass a daddr. loopback in fact passes
a 0 all the time ;-> 
This means i can delete the check totaly or i can remove the IFF_NOARP

Anyone knows the history?

cheers,
jamal



-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to