aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-04-08 16:39:54 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-08 16:39:54 -0400
commitfd1cc4802482d13ba1dbc44b390c5a6b16411a03 (patch)
treec9ce26890f0e8da455396121e3f8ed4dfb9daad2
parent577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff)
parent83731671d9e6878c0a05d309c68fb71c16d3235a (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h5
-rw-r--r--net/ipv6/netfilter/ip6_tables.c2
-rw-r--r--net/netfilter/Kconfig2
-rw-r--r--net/netfilter/nf_conntrack_expect.c30
4 files changed, 13 insertions, 26 deletions
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index ab17a159ac66..a9652806d0df 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -99,9 +99,12 @@ void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, u_int8_t,
99 const union nf_inet_addr *, 99 const union nf_inet_addr *,
100 u_int8_t, const __be16 *, const __be16 *); 100 u_int8_t, const __be16 *, const __be16 *);
101void nf_ct_expect_put(struct nf_conntrack_expect *exp); 101void nf_ct_expect_put(struct nf_conntrack_expect *exp);
102int nf_ct_expect_related(struct nf_conntrack_expect *expect);
103int nf_ct_expect_related_report(struct nf_conntrack_expect *expect, 102int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
104 u32 pid, int report); 103 u32 pid, int report);
104static inline int nf_ct_expect_related(struct nf_conntrack_expect *expect)
105{
106 return nf_ct_expect_related_report(expect, 0, 0);
107}
105 108
106#endif /*_NF_CONNTRACK_EXPECT_H*/ 109#endif /*_NF_CONNTRACK_EXPECT_H*/
107 110
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index dfed176aed37..800ae8542471 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1033,6 +1033,8 @@ static struct xt_counters *alloc_counters(struct xt_table *table)
1033 1033
1034 xt_free_table_info(info); 1034 xt_free_table_info(info);
1035 1035
1036 return counters;
1037
1036 free_counters: 1038 free_counters:
1037 vfree(counters); 1039 vfree(counters);
1038 nomem: 1040 nomem:
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index bb279bf59a1b..2329c5f50551 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -374,7 +374,7 @@ config NETFILTER_XT_TARGET_HL
374 374
375config NETFILTER_XT_TARGET_LED 375config NETFILTER_XT_TARGET_LED
376 tristate '"LED" target support' 376 tristate '"LED" target support'
377 depends on LEDS_CLASS && LED_TRIGGERS 377 depends on LEDS_CLASS && LEDS_TRIGGERS
378 depends on NETFILTER_ADVANCED 378 depends on NETFILTER_ADVANCED
379 help 379 help
380 This option adds a `LED' target, which allows you to blink LEDs in 380 This option adds a `LED' target, which allows you to blink LEDs in
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 3940f996a2e4..afde8f991646 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -372,7 +372,7 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)
372 struct net *net = nf_ct_exp_net(expect); 372 struct net *net = nf_ct_exp_net(expect);
373 struct hlist_node *n; 373 struct hlist_node *n;
374 unsigned int h; 374 unsigned int h;
375 int ret = 0; 375 int ret = 1;
376 376
377 if (!master_help->helper) { 377 if (!master_help->helper) {
378 ret = -ESHUTDOWN; 378 ret = -ESHUTDOWN;
@@ -412,41 +412,23 @@ out:
412 return ret; 412 return ret;
413} 413}
414 414
415int nf_ct_expect_related(struct nf_conntrack_expect *expect) 415int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
416 u32 pid, int report)
416{ 417{
417 int ret; 418 int ret;
418 419
419 spin_lock_bh(&nf_conntrack_lock); 420 spin_lock_bh(&nf_conntrack_lock);
420 ret = __nf_ct_expect_check(expect); 421 ret = __nf_ct_expect_check(expect);
421 if (ret < 0) 422 if (ret <= 0)
422 goto out; 423 goto out;
423 424
425 ret = 0;
424 nf_ct_expect_insert(expect); 426 nf_ct_expect_insert(expect);
425 atomic_inc(&expect->use);
426 spin_unlock_bh(&nf_conntrack_lock);
427 nf_ct_expect_event(IPEXP_NEW, expect);
428 nf_ct_expect_put(expect);
429 return ret;
430out:
431 spin_unlock_bh(&nf_conntrack_lock); 427 spin_unlock_bh(&nf_conntrack_lock);
428 nf_ct_expect_event_report(IPEXP_NEW, expect, pid, report);
432 return ret; 429 return ret;
433}
434EXPORT_SYMBOL_GPL(nf_ct_expect_related);
435
436int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
437 u32 pid, int report)
438{
439 int ret;
440
441 spin_lock_bh(&nf_conntrack_lock);
442 ret = __nf_ct_expect_check(expect);
443 if (ret < 0)
444 goto out;
445 nf_ct_expect_insert(expect);
446out: 430out:
447 spin_unlock_bh(&nf_conntrack_lock); 431 spin_unlock_bh(&nf_conntrack_lock);
448 if (ret == 0)
449 nf_ct_expect_event_report(IPEXP_NEW, expect, pid, report);
450 return ret; 432 return ret;
451} 433}
452EXPORT_SYMBOL_GPL(nf_ct_expect_related_report); 434EXPORT_SYMBOL_GPL(nf_ct_expect_related_report);