Lines Matching defs:sock
411 static inline int l2tp_verify_udp_checksum(struct sock *sk,
713 if (tunnel->sock && l2tp_verify_udp_checksum(tunnel->sock, skb))
823 int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
985 static inline void l2tp_skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
999 struct sock *sk = tunnel->sock;
1092 void l2tp_tunnel_destruct(struct sock *sk)
1117 tunnel->sock = NULL;
1158 /* Since we should hold the sock lock while
1161 * Hold a reference to the sock so it doesn't
1206 BUG_ON(tunnel->sock != NULL);
1231 struct socket *sock = NULL;
1239 sock = *sockp;
1245 err = kernel_bind(sock, (struct sockaddr *) &udp_addr, sizeof(udp_addr));
1252 err = kernel_connect(sock, (struct sockaddr *) &udp_addr, sizeof(udp_addr), 0);
1257 sock->sk->sk_no_check = UDP_CSUM_NOXMIT;
1266 sock = *sockp;
1272 err = kernel_bind(sock, (struct sockaddr *) &ip_addr, sizeof(ip_addr));
1279 err = kernel_connect(sock, (struct sockaddr *) &ip_addr, sizeof(ip_addr), 0);
1290 if ((err < 0) && sock) {
1291 sock_release(sock);
1302 struct socket *sock = NULL;
1303 struct sock *sk = NULL;
1312 err = l2tp_tunnel_sock_create(tunnel_id, peer_tunnel_id, cfg, &sock);
1317 sock = sockfd_lookup(fd, &err);
1318 if (!sock) {
1325 sk = sock->sk;
1395 tunnel->sock = sk;
1419 if (sock && sock->file)
1420 sockfd_put(sock);
1431 struct socket *sock = tunnel->sock ? tunnel->sock->sk_socket : NULL;
1437 if (sock != NULL) {
1438 err = inet_shutdown(sock, 2);
1444 if (sock->file == NULL)
1445 err = inet_release(sock);
1482 sock_put(tunnel->sock);
1586 sock_hold(tunnel->sock);