All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] intervals: don't assert when symbolic expression is to be split into a range
Date: Tue, 5 Dec 2023 15:18:38 +0100	[thread overview]
Message-ID: <ZW8xPv2DVo5J0Pd5@calendula> (raw)
In-Reply-To: <20231205130923.3633-1-fw@strlen.de>

On Tue, Dec 05, 2023 at 02:09:19PM +0100, Florian Westphal wrote:
> tests/shell/testcases/bogons/nft-f/set_definition_with_no_key_assert
> BUG: unhandled key type 2
> nft: src/intervals.c:59: setelem_expr_to_range: Assertion `0' failed.
> 
> Fixes: 3975430b12d9 ("src: expand table command before evaluation")
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  include/intervals.h                           |  1 -
>  src/intervals.c                               | 60 +++++++++++++++----
>  .../nft-f/set_definition_with_no_key_assert   | 12 ++++
>  3 files changed, 60 insertions(+), 13 deletions(-)
>  create mode 100644 tests/shell/testcases/bogons/nft-f/set_definition_with_no_key_assert
> 
[...]
> diff --git a/src/intervals.c b/src/intervals.c
> index 85de0199c373..7181af58013e 100644
> --- a/src/intervals.c
> +++ b/src/intervals.c
> @@ -13,7 +13,9 @@
>  #include <intervals.h>
>  #include <rule.h>
>  
> -static void setelem_expr_to_range(struct expr *expr)
> +static int set_to_range(struct expr *init);
> +
> +static int setelem_expr_to_range(struct expr *expr)
>  {
>  	unsigned char data[sizeof(struct in6_addr) * BITS_PER_BYTE];
>  	struct expr *key, *value;
> @@ -55,9 +57,13 @@ static void setelem_expr_to_range(struct expr *expr)
>  		expr_free(expr->key);
>  		expr->key = key;
>  		break;
> +	case EXPR_SYMBOL:
> +		return -1;

How can we get EXPR_SYMBOL in this path?

      reply	other threads:[~2023-12-05 14:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 13:09 [PATCH nft] intervals: don't assert when symbolic expression is to be split into a range Florian Westphal
2023-12-05 14:18 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZW8xPv2DVo5J0Pd5@calendula \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.