aboutsummaryrefslogtreecommitdiffstats
path: root/net/llc
diff options
context:
space:
mode:
Diffstat (limited to 'net/llc')
-rw-r--r--net/llc/llc_conn.c10
-rw-r--r--net/llc/llc_sap.c8
2 files changed, 15 insertions, 3 deletions
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
index 77bb3816655e..10cdfe2db830 100644
--- a/net/llc/llc_conn.c
+++ b/net/llc/llc_conn.c
@@ -682,10 +682,15 @@ static int llc_find_offset(int state, int ev_type)
682 */ 682 */
683void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk) 683void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk)
684{ 684{
685 struct llc_sock *llc = llc_sk(sk);
686 struct hlist_head *dev_hb = llc_sk_dev_hash(sap, llc->dev->ifindex);
687
685 llc_sap_hold(sap); 688 llc_sap_hold(sap);
686 spin_lock_bh(&sap->sk_lock);
687 llc_sk(sk)->sap = sap; 689 llc_sk(sk)->sap = sap;
690
691 spin_lock_bh(&sap->sk_lock);
688 sk_nulls_add_node_rcu(sk, &sap->sk_list); 692 sk_nulls_add_node_rcu(sk, &sap->sk_list);
693 hlist_add_head(&llc->dev_hash_node, dev_hb);
689 spin_unlock_bh(&sap->sk_lock); 694 spin_unlock_bh(&sap->sk_lock);
690} 695}
691 696
@@ -699,8 +704,11 @@ void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk)
699 */ 704 */
700void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk) 705void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk)
701{ 706{
707 struct llc_sock *llc = llc_sk(sk);
708
702 spin_lock_bh(&sap->sk_lock); 709 spin_lock_bh(&sap->sk_lock);
703 sk_nulls_del_node_init_rcu(sk); 710 sk_nulls_del_node_init_rcu(sk);
711 hlist_del(&llc->dev_hash_node);
704 spin_unlock_bh(&sap->sk_lock); 712 spin_unlock_bh(&sap->sk_lock);
705 llc_sap_put(sap); 713 llc_sap_put(sap);
706} 714}
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
index 94790e60d072..94cb706f6cc4 100644
--- a/net/llc/llc_sap.c
+++ b/net/llc/llc_sap.c
@@ -387,10 +387,14 @@ static void llc_sap_mcast(struct llc_sap *sap,
387{ 387{
388 int i = 0, count = 256 / sizeof(struct sock *); 388 int i = 0, count = 256 / sizeof(struct sock *);
389 struct sock *sk, *stack[count]; 389 struct sock *sk, *stack[count];
390 struct hlist_nulls_node *node; 390 struct hlist_node *node;
391 struct llc_sock *llc;
392 struct hlist_head *dev_hb = llc_sk_dev_hash(sap, skb->dev->ifindex);
391 393
392 spin_lock_bh(&sap->sk_lock); 394 spin_lock_bh(&sap->sk_lock);
393 sk_nulls_for_each_rcu(sk, node, &sap->sk_list) { 395 hlist_for_each_entry(llc, node, dev_hb, dev_hash_node) {
396
397 sk = &llc->sk;
394 398
395 if (!llc_mcast_match(sap, laddr, skb, sk)) 399 if (!llc_mcast_match(sap, laddr, skb, sk))
396 continue; 400 continue;