From: Philip Craig <philipc@snapgear.com>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] gre: transparent ethernet bridging
Date: Tue, 01 Aug 2006 11:15:29 +1000 [thread overview]
Message-ID: <44CEAB31.5090501@snapgear.com> (raw)
In-Reply-To: <20060731091423.3327f85e@dxpl.pdx.osdl.net>
Stephen Hemminger wrote:
> On Mon, 31 Jul 2006 20:06:41 +1000
> Philip Craig <philipc@snapgear.com> wrote:
>
>> This patch implements transparent ethernet bridging for gre tunnels.
>> There are a few outstanding issues.
>
> Why not use existing bridge code?
It does use the existing bridge code. Perhaps the name is misleading.
All it does is encapsulate the full ethernet header in a gre packet,
rather than only layer 3. That is, currently gre uses ARPHRD_IPGRE,
but bridging requires ARPHRD_ETHER.
>> Some routers set LLC_SAP_BSPAN in the gre protocol field, and then
>> give the bpdu packet without any other ethernet/llc header. This patch
>> currently tries to fake the ethernet/llc header before passing the
>> packet up, but it is buggy (mac addresses are wrong at least). Maybe a
>> better approach is to call directly into the bridging code. I didn't try
>> that at first because it isn't modular, and may break other things that
>> want to see the packet.
>
> Existing bridge code already has spanning tree.
Yes, and I want to use that. But this packet is a bit strange in
that it does not have the ethernet header on it. So what is the
best way to pass it to existing code? Either fake the ethernet
header, or pass it directly?
>> +#if 0
>> dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup);
>> +#else
>> + dev = alloc_netdev(sizeof(*t), name, ipgre_ether_tunnel_setup);
>> +#endif
>
> "Do, or do not there is no try"
I am looking for comments as to whether adding a netlink interface
to control this is appropriate.
>> +__be16 ipgre_type_trans(struct sk_buff *skb, int offset)
>> +{
>> + u8 *h = skb->data;
>> + __be16 flags = *(__be16*)h;
>> + __be16 proto = *(__be16*)(h + 2);
>> +
>> + /* WCCP version 1 and 2 protocol decoding.
>> + * - Change protocol to IP
>> + * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
>> + */
>> + if (flags == 0 &&
>> + proto == __constant_htons(ETH_P_WCCP)) {
>> + proto = __constant_htons(ETH_P_IP);
>> + if ((*(h + offset) & 0xF0) != 0x40)
>> + offset += 4;
>> + }
>
> Don't use __constant_htons() except in initializers and switch cases
> (where gcc is too stupid to optimize the macro).
>
This is a problem in the existing code, which I am simply moving
around. Should I fix it at the same time?
next prev parent reply other threads:[~2006-08-01 1:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-31 10:06 [RFC] gre: transparent ethernet bridging Philip Craig
2006-07-31 16:14 ` Stephen Hemminger
2006-08-01 1:15 ` Philip Craig [this message]
2006-08-01 5:08 ` Stephen Hemminger
2006-08-01 9:29 ` Philip Craig
2006-08-02 6:17 ` Philip Craig
2006-08-02 17:23 ` Stephen Hemminger
2006-08-03 1:08 ` Philip Craig
2006-08-02 7:42 ` Lennert Buytenhek
2006-08-03 1:33 ` Philip Craig
2006-08-03 7:33 ` Lennert Buytenhek
2006-08-03 9:14 ` Philip Craig
2006-08-03 19:40 ` Lennert Buytenhek
2006-08-04 1:00 ` Philip Craig
2006-08-04 8:02 ` Lennert Buytenhek
2006-08-07 1:55 ` Philip Craig
2006-08-10 13:09 ` Lennert Buytenhek
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=44CEAB31.5090501@snapgear.com \
--to=philipc@snapgear.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@osdl.org \
/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).