Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Elise Lennion <elise.lennion@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] erec: Make error messages in nft consistent
Date: Tue, 15 Nov 2016 20:56:31 +0100	[thread overview]
Message-ID: <20161115195631.GA4297@salvia> (raw)
In-Reply-To: <20161115195010.GA3948@salvia>

On Tue, Nov 15, 2016 at 08:50:10PM +0100, Pablo Neira Ayuso wrote:
> On Tue, Nov 15, 2016 at 05:22:38PM -0200, Elise Lennion wrote:
> > Error messages in nft should start with "syntax error" to keep
> > consistency. A new function add_syntax_error() was created to add this
> > prefix when necessary.
> 
> Probably you can just add EREC_SYNTAX_ERROR to enum
> error_record_types, then add:
> 
> #define syntax_error(loc, fmt, args...) \
>        erec_create(EREC_SYNTA_ERROR, (loc), (fmt), ## args)

Actually, git grep "erec_queue(error(" tells me all:

        erec_queue(error(...

occur in parser_bison.y, so we can just update #define error in erec.h

You will have to define something like __error, which doesn't include
the "syntax error" string, as bison is already including it in this
spot below:

static void yyerror(struct location *loc, void *scanner,
                    struct parser_state *state, const char *s)
{
        erec_queue(__error(loc, "%s", s), state->msgs);
}

So it will be a simple patch in the end.

Thanks.

      reply	other threads:[~2016-11-15 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 19:22 [PATCH] erec: Make error messages in nft consistent Elise Lennion
2016-11-15 19:50 ` Pablo Neira Ayuso
2016-11-15 19:56   ` 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=20161115195631.GA4297@salvia \
    --to=pablo@netfilter.org \
    --cc=elise.lennion@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox