Thread (17 messages) 17 messages, 4 authors, 2009-11-06

RE: How to use gretap with bridge?

From: Neulinger, Nathan <hidden>
Date: 2009-10-29 23:51:14

Possibly related (same subject, not in this thread)

Actually, it looks like it's broke here in ipgre_tunnel_init:
--- net/ipv4/ip_gre.c.orig      2009-10-29 18:45:29.335723326 -0500
+++ net/ipv4/ip_gre.c   2009-10-29 18:45:13.069697015 -0500
@@ -1240,7 +1240,8 @@
        tunnel->dev = dev;
        strcpy(tunnel->parms.name, dev->name);
 
-       memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
+       /* assign random mac addr on init */
+       random_ether_addr(dev->dev_addr);
        memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
 
        if (iph->daddr) {
The above change fixes it for me, but I'm no expert on this chunk of
code. (Perhaps it it shouldn't set dev_addr at all?)

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       nneul@mst.edu
Missouri S&T Information Technology    (573) 612-1412
System Administrator - Principal       KD0DMH

-----Original Message-----
From: Herbert Xu [mailto:herbert@gondor.apana.org.au]
Sent: Thursday, October 29, 2009 6:48 PM
To: Neulinger, Nathan
Cc: Stephen Hemminger; netdev@vger.kernel.org
Subject: Re: How to use gretap with bridge?

On Thu, Oct 29, 2009 at 05:04:02PM -0500, Neulinger, Nathan wrote:
quoted
Now I see it - Stephen actually had it right on - the problem is
that
quoted
the gre tunnel is creating a MAC address on the fly based on the
tunnel
quoted
endpoint ip address, so if the tunnel endpoint address starts with
an
quoted
odd number, it hits the multicast check in the bridging code. (I'm
sure
quoted
that's what he meant and I just missed it entirely.)

Simplest option would probably be to just mask off the first octet
with
quoted
0xFD or using the ip as the last four octets of the mac instead of
the
quoted
first four.
This looks like a bug in either iproute or the kernel.  It's
not supposed to set a MAC address unless the user specifically
gives one.  If one is not given the kernel will generate a valid
MAC address.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help