Commit 152375ff authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[NET]: netif_receive_skb() warning fix.

parent 171c62d7
...@@ -1482,15 +1482,29 @@ static __inline__ int handle_bridge(struct sk_buff *skb, ...@@ -1482,15 +1482,29 @@ static __inline__ int handle_bridge(struct sk_buff *skb,
#endif #endif
#ifdef CONFIG_NET_DIVERT static inline void handle_diverter(struct sk_buff *skb)
static inline int handle_diverter(struct sk_buff *skb)
{ {
#ifdef CONFIG_NET_DIVERT
/* if diversion is supported on device, then divert */ /* if diversion is supported on device, then divert */
if (skb->dev->divert && skb->dev->divert->divert) if (skb->dev->divert && skb->dev->divert->divert)
divert_frame(skb); divert_frame(skb);
#endif
}
static inline int __handle_bridge(struct sk_buff *skb,
struct packet_type **pt_prev, int *ret)
{
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
if (skb->dev->br_port) {
*ret = handle_bridge(skb, *pt_prev);
if (br_handle_frame_hook(skb) == 0)
return 1;
*pt_prev = NULL;
}
#endif
return 0; return 0;
} }
#endif /* CONFIG_NET_DIVERT */
int netif_receive_skb(struct sk_buff *skb) int netif_receive_skb(struct sk_buff *skb)
{ {
...@@ -1532,20 +1546,10 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -1532,20 +1546,10 @@ int netif_receive_skb(struct sk_buff *skb)
} }
} }
#ifdef CONFIG_NET_DIVERT handle_diverter(skb);
if (skb->dev->divert && skb->dev->divert->divert)
ret = handle_diverter(skb);
#endif /* CONFIG_NET_DIVERT */
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) if (__handle_bridge(skb, &pt_prev, &ret))
if (skb->dev->br_port) { goto out;
ret = handle_bridge(skb, pt_prev);
if (br_handle_frame_hook(skb) == 0)
goto out;
pt_prev = NULL;
}
#endif
list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type)&15], list) { list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type)&15], list) {
if (ptype->type == type && if (ptype->type == type &&
...@@ -1578,7 +1582,7 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -1578,7 +1582,7 @@ int netif_receive_skb(struct sk_buff *skb)
ret = NET_RX_DROP; ret = NET_RX_DROP;
} }
out: out:
rcu_read_unlock(); rcu_read_unlock();
return ret; return 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