On Wed, Jul 12, 2017 at 03:47:07PM -0700, Justin Pettit wrote:
> The function nx_put_raw() shouldn't append "ct_nw_proto" to nx_match if
> the corresponding mask isn't set.
> 
> Signed-off-by: Justin Pettit <[email protected]>
> ---
>  lib/nx-match.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/nx-match.c b/lib/nx-match.c
> index cb0cad8458b9..c64953b8892b 100644
> --- a/lib/nx-match.c
> +++ b/lib/nx-match.c
> @@ -1190,7 +1190,9 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, 
> const struct match *match,
>      nxm_put_ipv6(&ctx, MFF_CT_IPV6_DST, oxm,
>                   &flow->ct_ipv6_dst, &match->wc.masks.ct_ipv6_dst);
>      if (flow->ct_nw_proto) {
> -        nxm_put_8(&ctx, MFF_CT_NW_PROTO, oxm, flow->ct_nw_proto);
> +        if (match->wc.masks.ct_nw_proto) {
> +            nxm_put_8(&ctx, MFF_CT_NW_PROTO, oxm, flow->ct_nw_proto);
> +        }

Please use nxm_put_8m instead, e.g.:
nxm_put_8m(&ctx, MFF_CT_NW_PROTO, oxm, flow->ct_nw_proto,
           match->wc.masks.ct_nw_proto);

Thanks,

Ben.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to