Commit 44ef548f authored by Phil Sutter's avatar Phil Sutter Committed by David S. Miller

net: sched: fix act_ipt for LOG target

Before calling the destroy() or target() callbacks, the family parameter
field has to be initialized. Otherwise at least the LOG target will
refuse to work and upon removal oops the kernel.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb1f4202
...@@ -62,6 +62,7 @@ static void ipt_destroy_target(struct xt_entry_target *t) ...@@ -62,6 +62,7 @@ static void ipt_destroy_target(struct xt_entry_target *t)
struct xt_tgdtor_param par = { struct xt_tgdtor_param par = {
.target = t->u.kernel.target, .target = t->u.kernel.target,
.targinfo = t->data, .targinfo = t->data,
.family = NFPROTO_IPV4,
}; };
if (par.target->destroy != NULL) if (par.target->destroy != NULL)
par.target->destroy(&par); par.target->destroy(&par);
...@@ -195,6 +196,7 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a, ...@@ -195,6 +196,7 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
par.hooknum = ipt->tcfi_hook; par.hooknum = ipt->tcfi_hook;
par.target = ipt->tcfi_t->u.kernel.target; par.target = ipt->tcfi_t->u.kernel.target;
par.targinfo = ipt->tcfi_t->data; par.targinfo = ipt->tcfi_t->data;
par.family = NFPROTO_IPV4;
ret = par.target->target(skb, &par); ret = par.target->target(skb, &par);
switch (ret) { switch (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment