Commit f92f8719 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: nf_queue: check if rerouter is present before using it

Every rerouter needs to provide a save and a reroute function, we don't
need to check for them. But we do need to check if a rerouter is registered
at all for the current family, with bridging for example packets of
unregistered families can hit nf_queue.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e02f7d16
...@@ -155,13 +155,13 @@ int nf_queue(struct sk_buff **skb, ...@@ -155,13 +155,13 @@ int nf_queue(struct sk_buff **skb,
if (physoutdev) dev_hold(physoutdev); if (physoutdev) dev_hold(physoutdev);
} }
#endif #endif
if (queue_rerouter[pf]->save) if (queue_rerouter[pf])
queue_rerouter[pf]->save(*skb, info); queue_rerouter[pf]->save(*skb, info);
status = queue_handler[pf]->outfn(*skb, info, queuenum, status = queue_handler[pf]->outfn(*skb, info, queuenum,
queue_handler[pf]->data); queue_handler[pf]->data);
if (status >= 0 && queue_rerouter[pf]->reroute) if (status >= 0 && queue_rerouter[pf])
status = queue_rerouter[pf]->reroute(skb, info); status = queue_rerouter[pf]->reroute(skb, info);
read_unlock(&queue_handler_lock); read_unlock(&queue_handler_lock);
......
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