All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.cc>, Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v2 iptables-nft 1/3] xlate: get rid of escape_quotes
Date: Wed, 30 Nov 2022 08:47:19 +0100	[thread overview]
Message-ID: <20221130074719.GA17072@breakpoint.cc> (raw)
In-Reply-To: <Y4YnSH99kWqtHGeI@orbyte.nwl.cc>

Phil Sutter <phil@nwl.cc> wrote:
> On Tue, Nov 29, 2022 at 03:05:40PM +0100, Florian Westphal wrote:
> [...]
> > diff --git a/extensions/libxt_LOG.c b/extensions/libxt_LOG.c
> > index e3f4290ba003..b6fe0b2edda1 100644
> > --- a/extensions/libxt_LOG.c
> > +++ b/extensions/libxt_LOG.c
> > @@ -151,12 +151,8 @@ static int LOG_xlate(struct xt_xlate *xl,
> >  	const char *pname = priority2name(loginfo->level);
> >  
> >  	xt_xlate_add(xl, "log");
> > -	if (strcmp(loginfo->prefix, "") != 0) {
> > -		if (params->escape_quotes)
> > -			xt_xlate_add(xl, " prefix \\\"%s\\\"", loginfo->prefix);
> > -		else
> > -			xt_xlate_add(xl, " prefix \"%s\"", loginfo->prefix);
> > -	}
> > +	if (strcmp(loginfo->prefix, "") != 0)
> > +		xt_xlate_add(xl, " prefix \"%s\"", loginfo->prefix);
> 
> Use the occasion and replace the strcmp() call with a check for first
> array elem?

Can do, but gcc should do that substitution too.

> > +	bool				escape_quotes; /* not used anymore, retained for ABI */
> >  };
> 
> We *could* rename the variable to intentionally break API so people
> notice. OTOH, escape_quotes will always be false which is exactly what
> we need.

Dunno.  I suggest to keep it and remove it once we change ABI for some
other reason.

  reply	other threads:[~2022-11-30  7:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 14:05 [PATCH v2 iptables-nft 0/3] remove escape_quotes support Florian Westphal
2022-11-29 14:05 ` [PATCH v2 iptables-nft 1/3] xlate: get rid of escape_quotes Florian Westphal
2022-11-29 15:37   ` Phil Sutter
2022-11-30  7:47     ` Florian Westphal [this message]
2022-11-30  9:34       ` Phil Sutter
2022-11-29 14:05 ` [PATCH v2 iptables-nft 2/3] extensions: change expected output for new format Florian Westphal
2022-11-29 15:46   ` Phil Sutter
2022-11-30  8:00     ` Florian Westphal
2022-11-30  9:28       ` Phil Sutter
2022-11-29 14:05 ` [PATCH v2 iptables-nft 3/3] xlate-test: avoid shell entanglements Florian Westphal
2022-11-29 15:50   ` Phil Sutter

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=20221130074719.GA17072@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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.