Lines Matching refs:sk
113 struct sock *sk; in icmpv6_xmit_lock() local
117 sk = icmpv6_sk(net); in icmpv6_xmit_lock()
118 if (unlikely(!spin_trylock(&sk->sk_lock.slock))) { in icmpv6_xmit_lock()
126 return sk; in icmpv6_xmit_lock()
129 static __inline__ void icmpv6_xmit_unlock(struct sock *sk) in icmpv6_xmit_unlock() argument
131 spin_unlock_bh(&sk->sk_lock.slock); in icmpv6_xmit_unlock()
172 static bool icmpv6_xrlim_allow(struct sock *sk, u8 type, in icmpv6_xrlim_allow() argument
175 struct net *net = sock_net(sk); in icmpv6_xrlim_allow()
192 dst = ip6_route_output(net, sk, fl6); in icmpv6_xrlim_allow()
238 int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, in icmpv6_push_pending_frames() argument
245 skb = skb_peek(&sk->sk_write_queue); in icmpv6_push_pending_frames()
253 if (skb_queue_len(&sk->sk_write_queue) == 1) { in icmpv6_push_pending_frames()
263 skb_queue_walk(&sk->sk_write_queue, skb) { in icmpv6_push_pending_frames()
274 ip6_push_pending_frames(sk); in icmpv6_push_pending_frames()
325 struct sock *sk, in icmpv6_route_lookup() argument
332 err = ip6_dst_lookup(sk, &dst, fl6); in icmpv6_route_lookup()
349 dst = xfrm_lookup(net, dst, flowi6_to_flowi(fl6), sk, 0); in icmpv6_route_lookup()
364 err = ip6_dst_lookup(sk, &dst2, &fl2); in icmpv6_route_lookup()
368 dst2 = xfrm_lookup(net, dst2, flowi6_to_flowi(&fl2), sk, XFRM_LOOKUP_ICMP); in icmpv6_route_lookup()
395 struct sock *sk; in icmp6_send() local
480 sk = icmpv6_xmit_lock(net); in icmp6_send()
481 if (!sk) in icmp6_send()
483 sk->sk_mark = mark; in icmp6_send()
484 np = inet6_sk(sk); in icmp6_send()
486 if (!icmpv6_xrlim_allow(sk, type, &fl6)) in icmp6_send()
499 dst = icmpv6_route_lookup(net, skb, sk, &fl6); in icmp6_send()
519 err = ip6_append_data(sk, icmpv6_getfrag, &msg, in icmp6_send()
526 ip6_flush_pending_frames(sk); in icmp6_send()
528 err = icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr, in icmp6_send()
535 icmpv6_xmit_unlock(sk); in icmp6_send()
549 struct sock *sk; in icmpv6_echo_reply() local
583 sk = icmpv6_xmit_lock(net); in icmpv6_echo_reply()
584 if (!sk) in icmpv6_echo_reply()
586 sk->sk_mark = mark; in icmpv6_echo_reply()
587 np = inet6_sk(sk); in icmpv6_echo_reply()
594 err = ip6_dst_lookup(sk, &dst, &fl6); in icmpv6_echo_reply()
597 dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), sk, 0); in icmpv6_echo_reply()
610 err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr), in icmpv6_echo_reply()
617 ip6_flush_pending_frames(sk); in icmpv6_echo_reply()
619 err = icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr, in icmpv6_echo_reply()
624 icmpv6_xmit_unlock(sk); in icmpv6_echo_reply()
813 void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6, in icmpv6_flow_init() argument
826 security_sk_classify_flow(sk, flowi6_to_flowi(fl6)); in icmpv6_flow_init()
836 struct sock *sk; in icmpv6_sk_init() local
845 err = inet_ctl_sock_create(&sk, PF_INET6, in icmpv6_sk_init()
853 net->ipv6.icmp_sk[i] = sk; in icmpv6_sk_init()
861 lockdep_set_class(&sk->sk_dst_lock, in icmpv6_sk_init()
867 sk->sk_sndbuf = 2 * SKB_TRUESIZE(64 * 1024); in icmpv6_sk_init()