Skip to content

Commit

Permalink
[NETFILTER]: nf_queue: check if rerouter is present before using it
Browse files Browse the repository at this point in the history
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: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Feb 27, 2006
1 parent e02f7d1 commit f92f871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/netfilter/nf_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ int nf_queue(struct sk_buff **skb,
if (physoutdev) dev_hold(physoutdev);
}
#endif
if (queue_rerouter[pf]->save)
if (queue_rerouter[pf])
queue_rerouter[pf]->save(*skb, info);

status = queue_handler[pf]->outfn(*skb, info, queuenum,
queue_handler[pf]->data);

if (status >= 0 && queue_rerouter[pf]->reroute)
if (status >= 0 && queue_rerouter[pf])
status = queue_rerouter[pf]->reroute(skb, info);

read_unlock(&queue_handler_lock);
Expand Down

0 comments on commit f92f871

Please sign in to comment.