From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [RFC conntrack-tools PATCH] conntrack-tools: introduce conntrackdctl
Date: Sat, 6 Feb 2021 02:57:03 +0100 [thread overview]
Message-ID: <20210206015703.GA23084@salvia> (raw)
In-Reply-To: <20210205122824.GA16269@salvia>
On Fri, Feb 05, 2021 at 01:28:24PM +0100, Pablo Neira Ayuso wrote:
> On Thu, Feb 04, 2021 at 11:32:06AM +0100, Arturo Borrero Gonzalez wrote:
> > Separate conntrackd command line client functionalities into a different
> > binary.
> >
> > This should help with several things:
> > * avoid reading and parsing the config file, which can fail in some enviroments, for example if
> > conntrackd is running inside a netns and the referenced interfaces/addresses doesn't exist in
> > the namespace conntrackd client command is running from.
> > * easily update conntrakdctl with more functionalities without polluting the daemon binary
> > * easier code maintenance
> [...]
> > @@ -333,15 +151,6 @@ int main(int argc, char *argv[])
> > exit(EXIT_FAILURE);
> > }
> >
> > - if (type == REQUEST) {
> > - if (do_local_request(action, &conf.local, local_step) == -1) {
> > - dlog(LOG_ERR, "can't connect: is conntrackd "
> > - "running? appropriate permissions?");
> > - exit(EXIT_FAILURE);
> > - }
> > - exit(EXIT_SUCCESS);
> > - }
>
> The existing interface needs to be in place to be backward compatible.
>
> I'm fine for you to add this, but we'll have to leave the existing
> interface for quite a bit of time, it might take years before we can
> deprecate the old way.
You could probably update conntrackd to invoke conntrackdctl when you
detect options that represent queries to the daemon. That would allow
you to retain backward compatibility. Hence, old scripts still work
while new ones might start using the new conntrackdctl command.
If the problem is that you would like to skip the config parsing
(which is what has triggered the errors when running things from the
netns environment IIRC), then, you could update the code to skip the
parsing:
- the user does not specify a configuration file
AND
- the options refer to a query to the daemon via UNIX socket.
That's another possibility to consider.
prev parent reply other threads:[~2021-02-06 3:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 10:32 [RFC conntrack-tools PATCH] conntrack-tools: introduce conntrackdctl Arturo Borrero Gonzalez
2021-02-05 12:28 ` Pablo Neira Ayuso
2021-02-06 1:57 ` 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=20210206015703.GA23084@salvia \
--to=pablo@netfilter.org \
--cc=arturo@netfilter.org \
--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;
as well as URLs for NNTP newsgroup(s).