Re: [PATCH net-next v3 2/8] gtp: switch from struct socket to struct sock for the GTP sockets

2017-02-15 Thread David Miller
From: Andreas Schultz Date: Wed, 15 Feb 2017 08:04:56 +0100 (CET) > - On Feb 14, 2017, at 6:48 PM, David S. Miller da...@davemloft.net wrote: > >> From: Andreas Schultz >> Date: Mon, 13 Feb 2017 16:36:18 +0100 >> >>> + if (gtp->sk0) { >>> + udp_sk(gtp->sk0)->encap_type = 0; >>>

Re: [PATCH net-next v3 2/8] gtp: switch from struct socket to struct sock for the GTP sockets

2017-02-14 Thread Andreas Schultz
- On Feb 14, 2017, at 6:48 PM, David S. Miller da...@davemloft.net wrote: > From: Andreas Schultz > Date: Mon, 13 Feb 2017 16:36:18 +0100 > >> +if (gtp->sk0) { >> +udp_sk(gtp->sk0)->encap_type = 0; >> +rcu_assign_sk_user_data(gtp->sk0, NULL); >> +sock_

Re: [PATCH net-next v3 2/8] gtp: switch from struct socket to struct sock for the GTP sockets

2017-02-14 Thread David Miller
From: Andreas Schultz Date: Mon, 13 Feb 2017 16:36:18 +0100 > + if (gtp->sk0) { > + udp_sk(gtp->sk0)->encap_type = 0; > + rcu_assign_sk_user_data(gtp->sk0, NULL); > + sock_put(gtp->sk0); > } This does "sock_put(NULL);" because you are assigning gtp->

[PATCH net-next v3 2/8] gtp: switch from struct socket to struct sock for the GTP sockets

2017-02-13 Thread Andreas Schultz
After enabling the UDP encapsulation, only the sk member is used. Holding the socket would prevent user space from closing the socket, but holding a reference to the sk member does not have the same effect. This change will make it simpler to later detach the sockets from the netdevice. Signed-o