netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH] net: sched: fix act_ipt for LOG target
@ 2016-03-03 13:34 Phil Sutter
  2016-03-03 14:25 ` Jamal Hadi Salim
  2016-03-07  3:58 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Phil Sutter @ 2016-03-03 13:34 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Phil Sutter, Jamal Hadi Salim

From: Phil Sutter <phil@nwl.cc>

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: Phil Sutter <phil@nwl.cc>
---
 net/sched/act_ipt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 89c41a1f35894..350e134cffb32 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -66,6 +66,7 @@ static void ipt_destroy_target(struct xt_entry_target *t)
 	struct xt_tgdtor_param par = {
 		.target   = t->u.kernel.target,
 		.targinfo = t->data,
+		.family   = NFPROTO_IPV4,
 	};
 	if (par.target->destroy != NULL)
 		par.target->destroy(&par);
@@ -219,6 +220,7 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
 	par.hooknum  = ipt->tcfi_hook;
 	par.target   = ipt->tcfi_t->u.kernel.target;
 	par.targinfo = ipt->tcfi_t->data;
+	par.family   = NFPROTO_IPV4;
 	ret = par.target->target(skb, &par);
 
 	switch (ret) {
-- 
2.7.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [net PATCH] net: sched: fix act_ipt for LOG target
  2016-03-03 13:34 [net PATCH] net: sched: fix act_ipt for LOG target Phil Sutter
@ 2016-03-03 14:25 ` Jamal Hadi Salim
  2016-03-07  3:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jamal Hadi Salim @ 2016-03-03 14:25 UTC (permalink / raw)
  To: Phil Sutter, netdev; +Cc: David Miller, Phil Sutter

On 16-03-03 08:34 AM, Phil Sutter wrote:
> From: Phil Sutter <phil@nwl.cc>
>
> 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: Phil Sutter <phil@nwl.cc>

Caveat: ipt has not been receiving a lot of love. Thanks for showing
it some love. If indeed you have tested this with the LOG target, then:

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [net PATCH] net: sched: fix act_ipt for LOG target
  2016-03-03 13:34 [net PATCH] net: sched: fix act_ipt for LOG target Phil Sutter
  2016-03-03 14:25 ` Jamal Hadi Salim
@ 2016-03-07  3:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-03-07  3:58 UTC (permalink / raw)
  To: psutter; +Cc: netdev, phil, jhs

From: Phil Sutter <psutter@redhat.com>
Date: Thu,  3 Mar 2016 14:34:14 +0100

> From: Phil Sutter <phil@nwl.cc>
> 
> 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: Phil Sutter <phil@nwl.cc>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-07  3:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 13:34 [net PATCH] net: sched: fix act_ipt for LOG target Phil Sutter
2016-03-03 14:25 ` Jamal Hadi Salim
2016-03-07  3:58 ` David Miller

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).