提交 23dbe791 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

[LLC]: use rcu_dereference on receive handler

The receive hander pointer might be modified during network changes
of protocol. So use rcu_dereference (only matters on alpha).
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 29efcd26
...@@ -142,6 +142,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -142,6 +142,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
struct llc_sap *sap; struct llc_sap *sap;
struct llc_pdu_sn *pdu; struct llc_pdu_sn *pdu;
int dest; int dest;
int (*rcv)(struct sk_buff *, struct net_device *,
struct packet_type *, struct net_device *);
/* /*
* When the interface is in promisc. mode, drop all the crap that it * When the interface is in promisc. mode, drop all the crap that it
...@@ -169,8 +171,9 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -169,8 +171,9 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
* First the upper layer protocols that don't need the full * First the upper layer protocols that don't need the full
* LLC functionality * LLC functionality
*/ */
if (sap->rcv_func) { rcv = rcu_dereference(sap->rcv_func);
sap->rcv_func(skb, dev, pt, orig_dev); if (rcv) {
rcv(skb, dev, pt, orig_dev);
goto out_put; goto out_put;
} }
dest = llc_pdu_type(skb); dest = llc_pdu_type(skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册