[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimmu+R=37tgctZNMchCdyUwbxo7S8ZT0ZX9Gpte@mail.gmail.com>
Date: Wed, 3 Nov 2010 14:35:41 -0700
From: Jesse Gross <jesse@...ira.com>
To: Michał Mirosław <mirqus@...il.com>
Cc: Timo Teräs <timo.teras@....fi>,
netdev@...r.kernel.org, Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCH] xfrm: use gre key as flow upper protocol info
2010/11/3 Michał Mirosław <mirqus@...il.com>:
> 2010/11/3 Timo Teräs <timo.teras@....fi>:
>> The GRE Key field is intended to be used for identifying an individual
>> traffic flow within a tunnel. It is useful to be able to have XFRM
>> policy selector matches to have different policies for different
>> GRE tunnels.
> [...]
>> diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
>> index 4464f3b..57af4bd 100644
>> --- a/net/ipv4/xfrm4_policy.c
>> +++ b/net/ipv4/xfrm4_policy.c
>> @@ -158,6 +159,20 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
>> fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
>> }
>> break;
>> +
>> + case IPPROTO_GRE:
>> + if (pskb_may_pull(skb, xprth + 12 - skb->data)) {
>> + __be16 *greflags = (__be16 *)xprth;
>> + __be32 *gre_hdr = (__be32 *)xprth;
>> +
>> + if (greflags[0] & GRE_KEY) {
>> + if (greflags[0] & GRE_CSUM)
>> + gre_hdr++;
>> + fl->fl_gre_key = gre_hdr[1];
>> + }
>> + }
>> + break;
>> +
>> default:
>> fl->fl_ipsec_spi = 0;
>> break;
>
> I would expect that keyless tunnel would be separate from key 0 tunnel.
No key and key 0 are generally treated the same. Both will match the
same tunnel when doing the lookup in the GRE receive path.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists