> There is bug in dpif-packet clone where it does not copy
> pading size for buffer. That resulted in incorrect SCTP
> checksum. This pach also fixes this issue.
> 

<pedantic> Two typos above - 'pading' and 'pach', respectively </pedantic>. 
Looks good otherwise.

> Signed-off-by: Pravin B Shelar <pshe...@nicira.com>
> ---
>  lib/ofpbuf.h          |    5 ++---
>  lib/packet-dpif.c     |    1 +
>  tests/ofproto-dpif.at |    6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h
> index 4e7038d..c0a55bb 100644
> --- a/lib/ofpbuf.h
> +++ b/lib/ofpbuf.h
> @@ -337,9 +337,8 @@ static inline void ofpbuf_set_l4(struct ofpbuf *b, void 
> *l4)
>  static inline size_t ofpbuf_l4_size(const struct ofpbuf *b)
>  {
>      return b->l4_ofs != UINT16_MAX
> -        ? (const char *)ofpbuf_tail(b) - (const char *)ofpbuf_l4(b)
> -        - ofpbuf_l2_pad_size(b)
> -        : 0;
> +           ? ofpbuf_size(b) - ofpbuf_l2_pad_size(b) - b->l4_ofs
> +           : 0;
>  }
> 
>  static inline const void *ofpbuf_get_tcp_payload(const struct ofpbuf *b)
> diff --git a/lib/packet-dpif.c b/lib/packet-dpif.c
> index db739c5..bc0e236 100644
> --- a/lib/packet-dpif.c
> +++ b/lib/packet-dpif.c
> @@ -53,6 +53,7 @@ dpif_packet_clone_from_ofpbuf(const struct ofpbuf *b)
>      p->ofpbuf.l2_5_ofs = b->l2_5_ofs;
>      p->ofpbuf.l3_ofs = b->l3_ofs;
>      p->ofpbuf.l4_ofs = b->l4_ofs;
> +    p->ofpbuf.l2_pad_size = b->l2_pad_size;
> 
>      return p;
>  }

(snip)

> --
> 1.7.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

Acked-by: Mark Kavanagh <mark.b.kavan...@intel.com>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to