On Thu, Oct 4, 2012 at 5:33 AM, Pravin B Shelar <pshe...@nicira.com> wrote:
> v1-v2:
>         - Fixed according to comments from Ben and Jesse.
>
> --8<--------------------------cut here-------------------------->8--
> Extend GRE to have a 64-bit key. Use GRE sequence number to
> store upper 32-bits of the key, this is not standard way of
> using GRE sequence number.
>
> Bug #13186
> Signed-off-by: Pravin B Shelar <pshe...@nicira.com>

There's an extra single quote at the end of the patch subject.

> diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
> index ab89c5b..24860eb 100644
> --- a/datapath/vport-gre.c
> +++ b/datapath/vport-gre.c
> @@ -158,14 +187,20 @@ static int parse_header(struct iphdr *iph, __be16 
> *flags, __be64 *key)
>         }
>
>         if (greh->flags & GRE_KEY) {
> -               hdr_len += GRE_HEADER_SECTION;
> +               __be32 seq = 0;
>
> -               *key = be32_extend_to_be64(*options);
> -               options++;
> +               hdr_len += GRE_HEADER_SECTION;
> +               if (greh->flags & GRE_SEQ) {
> +                       seq = *(options + 1);
> +                       *tunnel_type = TNL_T_PROTO_GRE64;
> +               } else {
> +                       *tunnel_type = TNL_T_PROTO_GRE;
> +               }
> +               *key = key_to_tunnel_id(*options, seq);

Can you do the key first and increment options so that the parsing
happens in the same order as the packet?

Also, while the ordering looks correct to me, did you verify using
Wireshark or similar that all the fields are what you expect?
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to