From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nf_tables PATCH 2/2] netfilter: nf_tables: split nft_log in AF-specific modules
Date: Mon, 2 Jun 2014 13:38:50 +0200 [thread overview]
Message-ID: <20140602113850.GB17123@localhost> (raw)
In-Reply-To: <20140602112620.2928.42032.stgit@nfdev.cica.es>
On Mon, Jun 02, 2014 at 01:26:20PM +0200, Arturo Borrero Gonzalez wrote:
> diff --git a/net/netfilter/nft_log_inet.c b/net/netfilter/nft_log_inet.c
> new file mode 100644
> index 0000000..b982df8
> --- /dev/null
> +++ b/net/netfilter/nft_log_inet.c
> @@ -0,0 +1,70 @@
> +/*
> + * Copyright (c) 2008-2009 Patrick McHardy <kaber@trash.net>
> + * Copyright (c) 2014 Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/netlink.h>
> +#include <linux/netfilter.h>
> +#include <linux/netfilter/nf_tables.h>
> +#include <net/netfilter/nf_tables.h>
> +#include <net/netfilter/nf_log.h>
> +#include <linux/netdevice.h>
> +#include <net/netfilter/nft_log.h>
> +#include <net/netfilter/ipv4/nft_log_ipv4.h>
> +#include <net/netfilter/ipv6/nft_log_ipv6.h>
> +
> +static void nft_log_inet_eval(const struct nft_expr *expr,
> + struct nft_data data[NFT_REG_MAX + 1],
> + const struct nft_pktinfo *pkt)
> +{
> + switch (pkt->ops->pf) {
> + case NFPROTO_IPV4:
> + nft_log_ipv4_eval(expr, data, pkt);
missing break here. Otherwise, it falls back on the IPv6 code too.
> + case NFPROTO_IPV6:
> + nft_log_ipv6_eval(expr, data, pkt);
Not really needed, but my suggestion is to add it here as well for
consistency.
prev parent reply other threads:[~2014-06-02 11:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-02 11:26 [nf_tables PATCH 1/2] netfilter: logging: factorize logging code to allow reutilization Arturo Borrero Gonzalez
2014-06-02 11:26 ` [nf_tables PATCH 2/2] netfilter: nf_tables: split nft_log in AF-specific modules Arturo Borrero Gonzalez
2014-06-02 11:36 ` Pablo Neira Ayuso
2014-06-02 11:38 ` 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=20140602113850.GB17123@localhost \
--to=pablo@netfilter.org \
--cc=arturo.borrero.glez@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 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.