[ovs-dev] [PATCH v2 04/21] expr: Tolerate having no macros.

Ryan Moats rmoats at us.ibm.com
Mon Aug 8 17:02:30 UTC 2016


"dev" <dev-bounces at openvswitch.org> wrote on 08/08/2016 11:14:15 AM:

> From: Ben Pfaff <blp at ovn.org>
> To: dev at openvswitch.org
> Cc: Ben Pfaff <blp at ovn.org>
> Date: 08/08/2016 11:15 AM
> Subject: [ovs-dev] [PATCH v2 04/21] expr: Tolerate having no macros.
> Sent by: "dev" <dev-bounces at openvswitch.org>
>
> A null set of macros seems reasonable, so tolerate it.
>
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
>  ovn/lib/expr.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c
> index cb61b5d..050e694 100644
> --- a/ovn/lib/expr.c
> +++ b/ovn/lib/expr.c
> @@ -735,7 +735,9 @@ parse_macros(struct expr_context *ctx, struct
> expr_constant_set *cs,
>               size_t *allocated_values)
>  {
>      struct expr_constant_set *addr_set
> -        = shash_find_data(ctx->macros, ctx->lexer->token.s);
> +        = (ctx->macros
> +           ? shash_find_data(ctx->macros, ctx->lexer->token.s)
> +           : NULL);
>      if (!addr_set) {
>          expr_syntax_error(ctx, "expecting address set name.");
>          return false;
> --

No surprises with this one, so...

Acked-by: Ryan Moats <rmoats at us.ibm.com>



More information about the dev mailing list