netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 3/5] netfilter: nf_tables: Add meta expression key for bridge interface name
Date: Mon, 14 Apr 2014 13:36:57 +0200	[thread overview]
Message-ID: <20140414113657.GA21331@localhost> (raw)
In-Reply-To: <1396956324-17803-4-git-send-email-tomasz.bursztyka@linux.intel.com>

On Tue, Apr 08, 2014 at 02:25:22PM +0300, Tomasz Bursztyka wrote:
> NFT_META_BRI_IIFNAME to get packet input bridge interface name
> NFT_META_BRI_OIFNAME to get packet output bridge interface name
> 
> Such meta key are accessible only through NFPROTO_BRIDGE family, on a
> dedicated nft meta module: nft_meta_bridge.
> 
> Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org>
> Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
> ---
>  include/uapi/linux/netfilter/nf_tables.h |   4 +
>  net/bridge/Makefile                      |   1 +
>  net/bridge/netfilter/Kconfig             |  12 ++-
>  net/bridge/netfilter/Makefile            |   1 +
>  net/bridge/netfilter/nft_meta_bridge.c   | 139 +++++++++++++++++++++++++++++++
>  5 files changed, 156 insertions(+), 1 deletion(-)
>  create mode 100644 net/bridge/netfilter/nft_meta_bridge.c
> 
> diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
> index c88ccbf..45fb37c 100644
> --- a/include/uapi/linux/netfilter/nf_tables.h
> +++ b/include/uapi/linux/netfilter/nf_tables.h
> @@ -536,6 +536,8 @@ enum nft_exthdr_attributes {
>   * @NFT_META_SECMARK: packet secmark (skb->secmark)
>   * @NFT_META_NFPROTO: netfilter protocol
>   * @NFT_META_L4PROTO: layer 4 protocol number
> + * @NFT_META_BRI_IIFNAME: packet input bridge interface name
> + * @NFT_META_BRI_OIFNAME: packet output bridge interface name
>   */
>  enum nft_meta_keys {
>  	NFT_META_LEN,
> @@ -555,6 +557,8 @@ enum nft_meta_keys {
>  	NFT_META_SECMARK,
>  	NFT_META_NFPROTO,
>  	NFT_META_L4PROTO,
> +	NFT_META_BRI_IIFNAME,
> +	NFT_META_BRI_OIFNAME,
>  };
>  
>  /**
> diff --git a/net/bridge/Makefile b/net/bridge/Makefile
> index e85498b2f..58acd82 100644
> --- a/net/bridge/Makefile
> +++ b/net/bridge/Makefile
> @@ -16,4 +16,5 @@ bridge-$(CONFIG_BRIDGE_IGMP_SNOOPING) += br_multicast.o br_mdb.o
>  
>  bridge-$(CONFIG_BRIDGE_VLAN_FILTERING) += br_vlan.o
>  
> +obj-$(CONFIG_NF_TABLES_BRIDGE) += netfilter/
>  obj-$(CONFIG_BRIDGE_NF_EBTABLES) += netfilter/

I think you can add some backward compatibility alias:

config CONFIG_BRIDGE_NF_EBTABLES
        select CONFIG_NETFILTER_BRIDGE

so you can add CONFIG_NETFILTER_BRIDGE for that directory, which is
more generic.

obj-$(CONFIG_NETFILTER_BRIDGE) += netfilter/

> diff --git a/net/bridge/netfilter/Kconfig b/net/bridge/netfilter/Kconfig
> index 5ca74a0..906783d 100644
> --- a/net/bridge/netfilter/Kconfig
> +++ b/net/bridge/netfilter/Kconfig
> @@ -2,10 +2,20 @@
>  # Bridge netfilter configuration
>  #
>  #
> -config NF_TABLES_BRIDGE
> +menuconfig NF_TABLES_BRIDGE
>  	depends on NF_TABLES
>  	tristate "Ethernet Bridge nf_tables support"
>  
> +if NF_TABLES_BRIDGE
> +
> +config NFT_BRIDGE_META
> +	tristate "Netfilter nf_table bridge meta support"
> +	depends on NFT_META
> +	help
> +	  Add support for bridge dedicated meta key.
> +
> +endif # NF_TABLES_BRIDGE
> +
>  menuconfig BRIDGE_NF_EBTABLES
>  	tristate "Ethernet Bridge tables (ebtables) support"
>  	depends on BRIDGE && NETFILTER
> diff --git a/net/bridge/netfilter/Makefile b/net/bridge/netfilter/Makefile
> index ea7629f..6f2f394 100644
> --- a/net/bridge/netfilter/Makefile
> +++ b/net/bridge/netfilter/Makefile
> @@ -3,6 +3,7 @@
>  #
>  
>  obj-$(CONFIG_NF_TABLES_BRIDGE) += nf_tables_bridge.o
> +obj-$(CONFIG_NFT_BRIDGE_META)  += nft_meta_bridge.o
>  
>  obj-$(CONFIG_BRIDGE_NF_EBTABLES) += ebtables.o
>  
> diff --git a/net/bridge/netfilter/nft_meta_bridge.c b/net/bridge/netfilter/nft_meta_bridge.c
> new file mode 100644
> index 0000000..4f02109
> --- /dev/null
> +++ b/net/bridge/netfilter/nft_meta_bridge.c

I think you can remove the trailing _bridge, it's obvious that we're
already in the bridge directory.

Apart from those two, this looks good to me. Thanks Tomasz.

  reply	other threads:[~2014-04-14 11:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 11:25 [PATCH v3 0/5] Add suport for bridge if dev name meta exepression keys Tomasz Bursztyka
2014-04-08 11:25 ` [PATCH 1/5] netfilter: nf_tables: Stack expression type depending on their family Tomasz Bursztyka
2014-04-08 11:25 ` [PATCH 2/5] netfilter: nf_tables: Make meta expression core functions public Tomasz Bursztyka
2014-04-08 11:25 ` [PATCH 3/5] netfilter: nf_tables: Add meta expression key for bridge interface name Tomasz Bursztyka
2014-04-14 11:36   ` Pablo Neira Ayuso [this message]
2014-04-14 11:48     ` Tomasz Bursztyka
2014-04-14 11:55       ` Pablo Neira Ayuso
2014-04-08 11:25 ` [PATCH libnftnl 4/5] meta: Add support for input and output " Tomasz Bursztyka
2014-04-08 11:25 ` [PATCH 5/5] " Tomasz Bursztyka
  -- strict thread matches above, loose matches on Subject: below --
2014-04-14 12:41 [PATCH v4 0/5] Add suport for bridge if dev name meta expression keys Tomasz Bursztyka
2014-04-14 12:41 ` [PATCH 3/5] netfilter: nf_tables: Add meta expression key for bridge interface name Tomasz Bursztyka
2014-04-23 12:03   ` Pablo Neira Ayuso
2014-04-24  6:08     ` Tomasz Bursztyka
2014-04-24  8:38       ` Pablo Neira Ayuso
2014-04-04  9:47 [PATCH v2 0/4] Add suport for bridge if dev name meta exepression keys Tomasz Bursztyka
2014-04-04  9:47 ` [PATCH 3/5] netfilter: nf_tables: Add meta expression key for bridge interface name Tomasz Bursztyka
2014-03-27 12:47 [PATCH 0/5] Add suport for bridge if dev name meta exepression keys Tomasz Bursztyka
2014-03-27 12:47 ` [PATCH 3/5] netfilter: nf_tables: Add meta expression key for bridge interface name Tomasz Bursztyka
2014-03-27 12:59   ` Arturo Borrero Gonzalez
2014-03-27 13:07     ` Tomasz Bursztyka

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=20140414113657.GA21331@localhost \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=tomasz.bursztyka@linux.intel.com \
    /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).