diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 9 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 10 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 6 |
3 files changed, 16 insertions, 9 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index b3238d0101cc..3bab78330cf8 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -557,15 +557,18 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, | |||
557 | 557 | ||
558 | static inline int cleanup_entry(struct arpt_entry *e, unsigned int *i) | 558 | static inline int cleanup_entry(struct arpt_entry *e, unsigned int *i) |
559 | { | 559 | { |
560 | struct xt_tgdtor_param par; | ||
560 | struct arpt_entry_target *t; | 561 | struct arpt_entry_target *t; |
561 | 562 | ||
562 | if (i && (*i)-- == 0) | 563 | if (i && (*i)-- == 0) |
563 | return 1; | 564 | return 1; |
564 | 565 | ||
565 | t = arpt_get_target(e); | 566 | t = arpt_get_target(e); |
566 | if (t->u.kernel.target->destroy) | 567 | par.target = t->u.kernel.target; |
567 | t->u.kernel.target->destroy(t->u.kernel.target, t->data); | 568 | par.targinfo = t->data; |
568 | module_put(t->u.kernel.target->me); | 569 | if (par.target->destroy != NULL) |
570 | par.target->destroy(&par); | ||
571 | module_put(par.target->me); | ||
569 | return 0; | 572 | return 0; |
570 | } | 573 | } |
571 | 574 | ||
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index e592c54d4992..50b9a6c34c38 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -768,6 +768,7 @@ check_entry_size_and_hooks(struct ipt_entry *e, | |||
768 | static int | 768 | static int |
769 | cleanup_entry(struct ipt_entry *e, unsigned int *i) | 769 | cleanup_entry(struct ipt_entry *e, unsigned int *i) |
770 | { | 770 | { |
771 | struct xt_tgdtor_param par; | ||
771 | struct ipt_entry_target *t; | 772 | struct ipt_entry_target *t; |
772 | 773 | ||
773 | if (i && (*i)-- == 0) | 774 | if (i && (*i)-- == 0) |
@@ -776,9 +777,12 @@ cleanup_entry(struct ipt_entry *e, unsigned int *i) | |||
776 | /* Cleanup all matches */ | 777 | /* Cleanup all matches */ |
777 | IPT_MATCH_ITERATE(e, cleanup_match, NULL); | 778 | IPT_MATCH_ITERATE(e, cleanup_match, NULL); |
778 | t = ipt_get_target(e); | 779 | t = ipt_get_target(e); |
779 | if (t->u.kernel.target->destroy) | 780 | |
780 | t->u.kernel.target->destroy(t->u.kernel.target, t->data); | 781 | par.target = t->u.kernel.target; |
781 | module_put(t->u.kernel.target->me); | 782 | par.targinfo = t->data; |
783 | if (par.target->destroy != NULL) | ||
784 | par.target->destroy(&par); | ||
785 | module_put(par.target->me); | ||
782 | return 0; | 786 | return 0; |
783 | } | 787 | } |
784 | 788 | ||
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 6c7254e02561..7ac1677419a9 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -411,9 +411,9 @@ static bool clusterip_tg_check(const struct xt_tgchk_param *par) | |||
411 | } | 411 | } |
412 | 412 | ||
413 | /* drop reference count of cluster config when rule is deleted */ | 413 | /* drop reference count of cluster config when rule is deleted */ |
414 | static void clusterip_tg_destroy(const struct xt_target *target, void *targinfo) | 414 | static void clusterip_tg_destroy(const struct xt_tgdtor_param *par) |
415 | { | 415 | { |
416 | const struct ipt_clusterip_tgt_info *cipinfo = targinfo; | 416 | const struct ipt_clusterip_tgt_info *cipinfo = par->targinfo; |
417 | 417 | ||
418 | /* if no more entries are referencing the config, remove it | 418 | /* if no more entries are referencing the config, remove it |
419 | * from the list and destroy the proc entry */ | 419 | * from the list and destroy the proc entry */ |
@@ -421,7 +421,7 @@ static void clusterip_tg_destroy(const struct xt_target *target, void *targinfo) | |||
421 | 421 | ||
422 | clusterip_config_put(cipinfo->config); | 422 | clusterip_config_put(cipinfo->config); |
423 | 423 | ||
424 | nf_ct_l3proto_module_put(target->family); | 424 | nf_ct_l3proto_module_put(par->target->family); |
425 | } | 425 | } |
426 | 426 | ||
427 | #ifdef CONFIG_COMPAT | 427 | #ifdef CONFIG_COMPAT |