Commit 9fb9e414 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NET]: deliver_skb() cleanup

Cleanup of deliver_skb: get rid of unused argument and use it
in the NET_CLS_ACT hook.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 33c1abbe
...@@ -1670,7 +1670,7 @@ static void net_tx_action(struct softirq_action *h) ...@@ -1670,7 +1670,7 @@ static void net_tx_action(struct softirq_action *h)
} }
static __inline__ int deliver_skb(struct sk_buff *skb, static __inline__ int deliver_skb(struct sk_buff *skb,
struct packet_type *pt_prev, int last) struct packet_type *pt_prev)
{ {
atomic_inc(&skb->users); atomic_inc(&skb->users);
return pt_prev->func(skb, skb->dev, pt_prev); return pt_prev->func(skb, skb->dev, pt_prev);
...@@ -1685,7 +1685,7 @@ static __inline__ int handle_bridge(struct sk_buff *skb, ...@@ -1685,7 +1685,7 @@ static __inline__ int handle_bridge(struct sk_buff *skb,
{ {
int ret = NET_RX_DROP; int ret = NET_RX_DROP;
if (pt_prev) if (pt_prev)
ret = deliver_skb(skb, pt_prev, 0); ret = deliver_skb(skb, pt_prev);
return ret; return ret;
} }
...@@ -1785,15 +1785,14 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -1785,15 +1785,14 @@ int netif_receive_skb(struct sk_buff *skb)
list_for_each_entry_rcu(ptype, &ptype_all, list) { list_for_each_entry_rcu(ptype, &ptype_all, list) {
if (!ptype->dev || ptype->dev == skb->dev) { if (!ptype->dev || ptype->dev == skb->dev) {
if (pt_prev) if (pt_prev)
ret = deliver_skb(skb, pt_prev, 0); ret = deliver_skb(skb, pt_prev);
pt_prev = ptype; pt_prev = ptype;
} }
} }
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
if (pt_prev) { if (pt_prev) {
atomic_inc(&skb->users); ret = deliver_skb(skb, pt_prev);
ret = pt_prev->func(skb, skb->dev, pt_prev);
pt_prev = NULL; /* noone else should process this after*/ pt_prev = NULL; /* noone else should process this after*/
} else { } else {
skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd); skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd);
...@@ -1820,7 +1819,7 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -1820,7 +1819,7 @@ int netif_receive_skb(struct sk_buff *skb)
if (ptype->type == type && if (ptype->type == type &&
(!ptype->dev || ptype->dev == skb->dev)) { (!ptype->dev || ptype->dev == skb->dev)) {
if (pt_prev) if (pt_prev)
ret = deliver_skb(skb, pt_prev, 0); ret = deliver_skb(skb, pt_prev);
pt_prev = ptype; pt_prev = ptype;
} }
} }
......
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