aboutsummaryrefslogtreecommitdiffstats
path: root/net/phonet/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/phonet/socket.c')
-rw-r--r--net/phonet/socket.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index aa5b5a972bff..8c84190f22de 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -94,7 +94,28 @@ struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn)
94 spin_unlock_bh(&pnsocks.lock); 94 spin_unlock_bh(&pnsocks.lock);
95 95
96 return rval; 96 return rval;
97}
98
99/* Deliver a broadcast packet (only in bottom-half) */
100void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb)
101{
102 struct hlist_node *node;
103 struct sock *sknode;
104
105 spin_lock(&pnsocks.lock);
106 sk_for_each(sknode, node, &pnsocks.hlist) {
107 struct sk_buff *clone;
108
109 if (!net_eq(sock_net(sknode), net))
110 continue;
111 if (!sock_flag(sknode, SOCK_BROADCAST))
112 continue;
97 113
114 clone = skb_clone(skb, GFP_ATOMIC);
115 if (clone)
116 sk_receive_skb(sknode, clone, 0);
117 }
118 spin_unlock(&pnsocks.lock);
98} 119}
99 120
100void pn_sock_hash(struct sock *sk) 121void pn_sock_hash(struct sock *sk)