aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-02-02 03:40:36 -0500
committerDavid S. Miller <davem@davemloft.net>2007-02-02 03:40:36 -0500
commit239a87c87660d3b97a467a661eec927f0dfa9891 (patch)
tree105c2ef26a16c75ad36cb04a28b6bdeb317c8810
parente34efe3b100d0fbdf053128956c3dd0bc68754d6 (diff)
[NET_SCHED]: act_ipt: fix regression in ipt action
The x_tables patch broke target module autoloading in the ipt action by replacing the ipt_find_target call (which does autoloading) by xt_find_target (which doesn't do autoloading). Additionally xt_find_target may return ERR_PTR values in case of an error, which are not handled. Use xt_request_find_target, which does both autoloading and ERR_PTR handling properly. Also don't forget to drop the target module reference again when xt_check_target fails. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/act_ipt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index a9608064a4c3..01e69138578d 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -55,7 +55,8 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int
55 struct ipt_target *target; 55 struct ipt_target *target;
56 int ret = 0; 56 int ret = 0;
57 57
58 target = xt_find_target(AF_INET, t->u.user.name, t->u.user.revision); 58 target = xt_request_find_target(AF_INET, t->u.user.name,
59 t->u.user.revision);
59 if (!target) 60 if (!target)
60 return -ENOENT; 61 return -ENOENT;
61 62
@@ -63,9 +64,10 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int
63 64
64 ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t), 65 ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t),
65 table, hook, 0, 0); 66 table, hook, 0, 0);
66 if (ret) 67 if (ret) {
68 module_put(t->u.kernel.target->me);
67 return ret; 69 return ret;
68 70 }
69 if (t->u.kernel.target->checkentry 71 if (t->u.kernel.target->checkentry
70 && !t->u.kernel.target->checkentry(table, NULL, 72 && !t->u.kernel.target->checkentry(table, NULL,
71 t->u.kernel.target, t->data, 73 t->u.kernel.target, t->data,