summaryrefslogtreecommitdiff
path: root/net/llc/llc_input.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-05-25 15:09:37 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-17 21:26:04 -0700
commit23dbe7912dad6be71bb9e69cb819d05e2442d362 (patch)
tree89fedd1d2c2c1ab710cfd90e8a8bb1f513935797 /net/llc/llc_input.c
parent29efcd2666b3a465b40aa07ef1f4d79847303e2f (diff)
downloadlinux-3.10-23dbe7912dad6be71bb9e69cb819d05e2442d362.tar.gz
linux-3.10-23dbe7912dad6be71bb9e69cb819d05e2442d362.tar.bz2
linux-3.10-23dbe7912dad6be71bb9e69cb819d05e2442d362.zip
[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: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc/llc_input.c')
-rw-r--r--net/llc/llc_input.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index d62e0f9b9da..cb9f7f058f7 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -142,6 +142,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
struct llc_sap *sap;
struct llc_pdu_sn *pdu;
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
@@ -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
* LLC functionality
*/
- if (sap->rcv_func) {
- sap->rcv_func(skb, dev, pt, orig_dev);
+ rcv = rcu_dereference(sap->rcv_func);
+ if (rcv) {
+ rcv(skb, dev, pt, orig_dev);
goto out_put;
}
dest = llc_pdu_type(skb);