On Sat, Jul 27, 2013 at 10:27 PM, Andy Zhou <az...@nicira.com> wrote:
> This bug will cause mask values to corrupt the flow key value. So far
> the bug has not showed up because we don't write mask value when
> there is no mask Netlink attributes.  However, it needs to be fixed for
> the next and future commits where we will start to set default
> values for key and mask for missing Netlink attributes.
>
> Signed-off-by: Andy Zhou <az...@nicira.com>
> ---
>  datapath/flow.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/datapath/flow.c b/datapath/flow.c
> index 2c11408..ba775f4 100644
> --- a/datapath/flow.c
> +++ b/datapath/flow.c
> @@ -82,8 +82,9 @@ static void update_range__(struct sw_flow_match *match,
>         do { \
>                 update_range__(match, offsetof(struct sw_flow_key, field),  \
>                                      sizeof((match)->key->field), is_mask); \
> -               if (is_mask && match->mask != NULL) {                       \
> -                       (match)->mask->key.field = value;                   \
> +               if (is_mask) {                                              \
> +                       if ((match)->mask)                                  \
> +                               (match)->mask->key.field = value;           \

Shouldn't we also do this for the memcpy variant?
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to