netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe Longo <giuseppelng@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Giuseppe Longo <giuseppelng@gmail.com>
Subject: [PATCH 0/2] xtables-eb for the compatibility layer
Date: Wed,  5 Feb 2014 19:17:57 +0100	[thread overview]
Message-ID: <1391624279-4323-1-git-send-email-giuseppelng@gmail.com> (raw)

Hi,
this patchset implements ebtables for the nftables compatibility layer.
I would explain some points:

- The code is not built with the gcc version 4.7.3 (Gentoo 4.7.3-r1 p1.3, pie-0.5.5):
xtables_multi-nft-bridge.o:/home/giuseppe/git/iptables-nftables/iptables/nft-bridge.c:53: first defined here
xtables_multi-nft-bridge.o: In function `nft_rule_to_xtables_ebt_entry':
/home/giuseppe/git/iptables-nftables/iptables/nft-bridge.c:226: multiple definition of `nft_rule_to_xtables_ebt_entry'
xtables_multi-nft-bridge.o:/home/giuseppe/git/iptables-nftables/iptables/nft-bridge.c:226: first defined here
xtables_multi-nft-bridge.o:(.data+0x0): multiple definition of `nft_family_ops_bridge'
xtables_multi-nft-bridge.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status

but, with the gcc version 4.8.2 (Debian 4.8.2-1) (on my vm) it works fine.
I didn't figure out the reason, honestly.

- 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.
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.

Thanks

Giuseppe Longo (2):
  xtables: bootstrap xtables-eb for nftables
  Operations for bridge family

 include/linux/netfilter_bridge.h            |   33 +
 include/linux/netfilter_bridge/ebtables.h   |  276 +++++++
 include/linux/netfilter_bridge/ethernetdb.h |   58 ++
 iptables/Makefile.am                        |    8 +-
 iptables/getethertype.c                     |  161 ++++
 iptables/nft-bridge.c                       |  384 +++++++++
 iptables/nft-shared.c                       |    3 +
 iptables/nft.c                              |   28 +
 iptables/nft.h                              |   12 +
 iptables/xtables-eb-standalone.c            |   87 +++
 iptables/xtables-eb.c                       | 1122 +++++++++++++++++++++++++++
 iptables/xtables-ebtables.h                 |   39 +
 iptables/xtables-multi.c                    |    1 +
 iptables/xtables-multi.h                    |    1 +
 14 files changed, 2210 insertions(+), 3 deletions(-)
 create mode 100644 include/linux/netfilter_bridge.h
 create mode 100644 include/linux/netfilter_bridge/ebtables.h
 create mode 100644 include/linux/netfilter_bridge/ethernetdb.h
 create mode 100644 iptables/getethertype.c
 create mode 100644 iptables/nft-bridge.c
 create mode 100644 iptables/xtables-eb-standalone.c
 create mode 100644 iptables/xtables-eb.c
 create mode 100644 iptables/xtables-ebtables.h

-- 
1.8.1.5


             reply	other threads:[~2014-02-05 18:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 18:17 Giuseppe Longo [this message]
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 ` [PATCH 0/2] xtables-eb for the compatibility layer Bart De Schuymer
2014-02-06 11:20   ` 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=1391624279-4323-1-git-send-email-giuseppelng@gmail.com \
    --to=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).