From: Bart De Schuymer <bdschuym@pandora.be>
To: Giuseppe Longo <giuseppelng@gmail.com>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 0/2] xtables-eb for the compatibility layer
Date: Wed, 05 Feb 2014 21:43:12 +0100 [thread overview]
Message-ID: <52F2A260.2060806@pandora.be> (raw)
In-Reply-To: <1391624279-4323-1-git-send-email-giuseppelng@gmail.com>
Giuseppe Longo schreef op 5/02/2014 19:17:
> Hi,
> this patchset implements ebtables for the nftables compatibility layer.
> I would explain some points:
> - I didn't figure out how to replace some parts of codes, for istance:
> from xtables-eb.c, line 928:
> t = (struct ebt_u_target *)new_entry->t;
> if ((t->parse(c - t->option_offset, argv, argc, new_entry, &t->flags, &t->t))) {
> if (ebt_errormsg[0] != '\0')
> return -1;
> goto check_extension;
> }
>
> /* Is it a match_option? */
> for (m = ebt_matches; m; m = m->next)
> if (m->parse(c - m->option_offset, argv, argc, new_entry, &m->flags, &m->m))
> break;
>
> if (m != NULL) {
> if (ebt_errormsg[0] != '\0')
> return -1;
> if (m->used == 0) {
> ebt_add_match(new_entry, m);
> m->used = 1;
> }
> goto check_extension;
> }
>
> Looking at extensions, I noticed that any xtables_match/xtables_target have parse functions. Maybe I'm wrong.
The parse functions of the targets/matches/watchers will return 0 if the
command-line argument isn't one of their options. If the parse function
returns a non-zero value, the command line option belongs to that
target/match/watcher. So, unless you don't want support for
target/watcher/match command-line arguments, you will need that code.
> Even the code from line 992 is not very clear, about final checks. I don't know if I can remove this part of code.
The code you commented out checks for loops in the call chain and runs
the final_check functions of the target/matches/watchers. As an example,
the ebt_ip module's final_check function makes sure the Ethernet
protocol is specified to be IPv4.
I see you comment out more stuff below that. All I can tell you is that
it sure is required for correct behavior in the oldschool ebtables
program. Please take the time to figure this out (read the code
comments, step through the code with a debugger) because I doubt this
will be a smooth and stable integration process otherwise.
cheers,
Bart
next prev parent reply other threads:[~2014-02-05 20:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-05 18:17 [PATCH 0/2] xtables-eb for the compatibility layer Giuseppe Longo
2014-02-05 18:17 ` [PATCH 1/2] xtables: bootstrap xtables-eb for nftables Giuseppe Longo
2014-02-05 23:26 ` Giuseppe Longo
2014-02-05 18:17 ` [PATCH 2/2] Operations for bridge family Giuseppe Longo
2014-02-05 20:43 ` Bart De Schuymer [this message]
2014-02-06 11:20 ` [PATCH 0/2] xtables-eb for the compatibility layer Giuseppe Longo
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=52F2A260.2060806@pandora.be \
--to=bdschuym@pandora.be \
--cc=giuseppelng@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;
as well as URLs for NNTP newsgroup(s).