linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Patrick McHardy <kaber@trash.net>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	Maxime Jayat <maxime@artisandeveloppeur.fr>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: linux-next: manual merge of the trivial tree
Date: Tue, 15 Oct 2013 16:02:42 +0200	[thread overview]
Message-ID: <1381845763-10487-2-git-send-email-treding@nvidia.com> (raw)
In-Reply-To: <1381845763-10487-1-git-send-email-treding@nvidia.com>

Today's linux-next merge of the trivial tree got conflicts in

	net/netfilter/xt_set.c

caused by commits 3f79410 (treewide: Fix common typo in "identify") and
bd3129f (netfilter: ipset: order matches and targets separatedly in
xt_set.c).

I fixed them up (see below). Please verify that the resolution looks
good.

Thanks,
Thierry
---
diff --cc net/netfilter/xt_set.c
index e7c4e0e,4b9d6b4..80c2e2d
--- a/net/netfilter/xt_set.c
+++ b/net/netfilter/xt_set.c
@@@ -81,10 -81,10 +81,10 @@@ set_match_v0_checkentry(const struct xt
  	struct xt_set_info_match_v0 *info = par->matchinfo;
  	ip_set_id_t index;
  
 -	index = ip_set_nfnl_get_byindex(info->match_set.index);
 +	index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
  
  	if (index == IPSET_INVALID_ID) {
- 		pr_warning("Cannot find set indentified by id %u to match\n",
+ 		pr_warning("Cannot find set identified by id %u to match\n",
  			   info->match_set.index);
  		return -ENOENT;
  	}
@@@ -106,104 -106,9 +106,104 @@@ set_match_v0_destroy(const struct xt_mt
  {
  	struct xt_set_info_match_v0 *info = par->matchinfo;
  
 -	ip_set_nfnl_put(info->match_set.index);
 +	ip_set_nfnl_put(par->net, info->match_set.index);
  }
  
 +/* Revision 1 match */
 +
 +static bool
 +set_match_v1(const struct sk_buff *skb, struct xt_action_param *par)
 +{
 +	const struct xt_set_info_match_v1 *info = par->matchinfo;
 +	ADT_OPT(opt, par->family, info->match_set.dim,
 +		info->match_set.flags, 0, UINT_MAX);
 +
 +	if (opt.flags & IPSET_RETURN_NOMATCH)
 +		opt.cmdflags |= IPSET_FLAG_RETURN_NOMATCH;
 +
 +	return match_set(info->match_set.index, skb, par, &opt,
 +			 info->match_set.flags & IPSET_INV_MATCH);
 +}
 +
 +static int
 +set_match_v1_checkentry(const struct xt_mtchk_param *par)
 +{
 +	struct xt_set_info_match_v1 *info = par->matchinfo;
 +	ip_set_id_t index;
 +
 +	index = ip_set_nfnl_get_byindex(par->net, info->match_set.index);
 +
 +	if (index == IPSET_INVALID_ID) {
- 		pr_warning("Cannot find set indentified by id %u to match\n",
++		pr_warning("Cannot find set identified by id %u to match\n",
 +			   info->match_set.index);
 +		return -ENOENT;
 +	}
 +	if (info->match_set.dim > IPSET_DIM_MAX) {
 +		pr_warning("Protocol error: set match dimension "
 +			   "is over the limit!\n");
 +		ip_set_nfnl_put(par->net, info->match_set.index);
 +		return -ERANGE;
 +	}
 +
 +	return 0;
 +}
 +
 +static void
 +set_match_v1_destroy(const struct xt_mtdtor_param *par)
 +{
 +	struct xt_set_info_match_v1 *info = par->matchinfo;
 +
 +	ip_set_nfnl_put(par->net, info->match_set.index);
 +}
 +
 +/* Revision 3 match */
 +
 +static bool
 +match_counter(u64 counter, const struct ip_set_counter_match *info)
 +{
 +	switch (info->op) {
 +	case IPSET_COUNTER_NONE:
 +		return true;
 +	case IPSET_COUNTER_EQ:
 +		return counter == info->value;
 +	case IPSET_COUNTER_NE:
 +		return counter != info->value;
 +	case IPSET_COUNTER_LT:
 +		return counter < info->value;
 +	case IPSET_COUNTER_GT:
 +		return counter > info->value;
 +	}
 +	return false;
 +}
 +
 +static bool
 +set_match_v3(const struct sk_buff *skb, struct xt_action_param *par)
 +{
 +	const struct xt_set_info_match_v3 *info = par->matchinfo;
 +	ADT_OPT(opt, par->family, info->match_set.dim,
 +		info->match_set.flags, info->flags, UINT_MAX);
 +	int ret;
 +
 +	if (info->packets.op != IPSET_COUNTER_NONE ||
 +	    info->bytes.op != IPSET_COUNTER_NONE)
 +		opt.cmdflags |= IPSET_FLAG_MATCH_COUNTERS;
 +
 +	ret = match_set(info->match_set.index, skb, par, &opt,
 +			info->match_set.flags & IPSET_INV_MATCH);
 +
 +	if (!(ret && opt.cmdflags & IPSET_FLAG_MATCH_COUNTERS))
 +		return ret;
 +
 +	if (!match_counter(opt.ext.packets, &info->packets))
 +		return 0;
 +	return match_counter(opt.ext.bytes, &info->bytes);
 +}
 +
 +#define set_match_v3_checkentry	set_match_v1_checkentry
 +#define set_match_v3_destroy	set_match_v1_destroy
 +
 +/* Revision 0 interface: backward compatible with netfilter/iptables */
 +
  static unsigned int
  set_target_v0(struct sk_buff *skb, const struct xt_action_param *par)
  {

  reply	other threads:[~2013-10-15 14:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 14:02 linux-next: Tree for Oct 15 Thierry Reding
2013-10-15 14:02 ` Thierry Reding [this message]
2013-10-16  9:12   ` linux-next: manual merge of the trivial tree Jozsef Kadlecsik
2013-10-16  9:20     ` Jiri Kosina
2013-10-16 14:56       ` Pablo Neira Ayuso
2013-10-16 20:10         ` Jozsef Kadlecsik
2013-10-15 14:02 ` [PATCH] [media] staging: media: Fix build for iMON LIRC driver Thierry Reding
2013-10-16  7:03   ` Dan Carpenter
2013-10-16 14:12     ` Greg Kroah-Hartman
2013-10-15 19:50 ` linux-next: Tree for Oct 15 (usb gadget f_mass_storage and storage_common) Randy Dunlap
2013-10-15 22:43 ` linux-next: Tree for Oct 15 (asymmetric keys) Randy Dunlap
2013-10-16 15:52   ` Thierry Reding
2013-10-19 17:07   ` Randy Dunlap
2013-10-16  5:21 ` linux-next: Tree for Oct 15 Guenter Roeck
2013-10-16 15:50   ` Thierry Reding
2013-10-16 16:37     ` Guenter Roeck
2013-10-16 16:43       ` Thierry Reding
  -- strict thread matches above, loose matches on Subject: below --
2008-11-03  3:48 linux-next: manual merge of the trivial tree Stephen Rothwell
2008-11-12 17:48 ` Jesper Juhl
2008-07-28  3:37 Stephen Rothwell
2008-07-28  9:41 ` Nick Andrew
2008-08-27  5:19   ` Stephen Rothwell
2008-07-07 15:39 Stephen Rothwell

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=1381845763-10487-2-git-send-email-treding@nvidia.com \
    --to=thierry.reding@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=maxime@artisandeveloppeur.fr \
    --cc=pablo@netfilter.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).