From: "Michał Mirosław" <mirqus@gmail.com>
To: Jesse Gross <jesse@nicira.com>
Cc: "Timo Teräs" <timo.teras@iki.fi>,
netdev@vger.kernel.org,
"Herbert Xu" <herbert@gondor.apana.org.au>
Subject: Re: [PATCH] xfrm: use gre key as flow upper protocol info
Date: Wed, 3 Nov 2010 22:46:42 +0100 [thread overview]
Message-ID: <AANLkTim_gutzLcL74aDVPJxFyRXi4x9rKJijBRHNVVog@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimmu+R=37tgctZNMchCdyUwbxo7S8ZT0ZX9Gpte@mail.gmail.com>
W dniu 3 listopada 2010 22:35 użytkownik Jesse Gross <jesse@nicira.com> napisał:
> 2010/11/3 Michał Mirosław <mirqus@gmail.com>:
>> 2010/11/3 Timo Teräs <timo.teras@iki.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.
I read the code again, and indeed it is. I was sure that they were
treated separately some time ago, but git knows nothing about it.
Best Regards,
Michał Mirosław
next prev parent reply other threads:[~2010-11-03 21:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-03 14:41 [PATCH] xfrm: use gre key as flow upper protocol info Timo Teräs
2010-11-03 20:16 ` Michał Mirosław
2010-11-03 21:35 ` Jesse Gross
2010-11-03 21:46 ` Michał Mirosław [this message]
2010-11-15 18:43 ` David Miller
2010-11-23 14:03 ` Timo Teräs
2010-11-28 19:22 ` David Miller
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=AANLkTim_gutzLcL74aDVPJxFyRXi4x9rKJijBRHNVVog@mail.gmail.com \
--to=mirqus@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=jesse@nicira.com \
--cc=netdev@vger.kernel.org \
--cc=timo.teras@iki.fi \
/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).