Lines Matching refs:sk
195 __u32 cookie_v4_init_sequence(struct sock *sk, const struct sk_buff *skb, in cookie_v4_init_sequence() argument
201 tcp_synq_overflow(sk); in cookie_v4_init_sequence()
202 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESSENT); in cookie_v4_init_sequence()
222 static struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb, in get_cookie_sock() argument
226 struct inet_connection_sock *icsk = inet_csk(sk); in get_cookie_sock()
229 child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst); in get_cookie_sock()
232 inet_csk_reqsk_queue_add(sk, req, child); in get_cookie_sock()
291 struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) in cookie_v4_check() argument
297 struct tcp_sock *tp = tcp_sk(sk); in cookie_v4_check()
300 struct sock *ret = sk; in cookie_v4_check()
310 if (tcp_synq_no_recent_overflow(sk)) in cookie_v4_check()
315 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED); in cookie_v4_check()
319 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV); in cookie_v4_check()
329 req = inet_reqsk_alloc(&tcp_request_sock_ops, sk); /* for safety */ in cookie_v4_check()
342 ireq->ir_mark = inet_request_mark(sk, skb); in cookie_v4_check()
351 ireq->ir_iif = sk->sk_bound_dev_if; in cookie_v4_check()
358 if (security_inet_conn_request(sk, skb, req)) { in cookie_v4_check()
371 flowi4_init_output(&fl4, sk->sk_bound_dev_if, ireq->ir_mark, in cookie_v4_check()
372 RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE, IPPROTO_TCP, in cookie_v4_check()
373 inet_sk_flowi_flags(sk), in cookie_v4_check()
377 rt = ip_route_output_key(sock_net(sk), &fl4); in cookie_v4_check()
386 tcp_select_initial_window(tcp_full_space(sk), req->mss, in cookie_v4_check()
392 ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), &rt->dst); in cookie_v4_check()
394 ret = get_cookie_sock(sk, skb, req, &rt->dst); in cookie_v4_check()