[PATCH net-next v2 5/6] gtp: add socket to pdp context

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Pablo Neira Ayuso pablo at netfilter.org
Thu Feb 2 13:56:56 UTC 2017


On Mon, Jan 30, 2017 at 05:37:12PM +0100, Andreas Schultz wrote:
> Having the socket present in context simplifies the sending logic.
> It also fixes the invalid assumption that we have to use the same
> sending socket for all client IP's on a specific gtp interface.
> 
> Signed-off-by: Andreas Schultz <aschultz at tpip.net>
> ---
>  drivers/net/gtp.c | 72 ++++++++++++++++++++++++++++++-------------------------
>  1 file changed, 39 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index 68c6c9b..ff00597 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
[...]
> @@ -984,16 +966,26 @@ static int ipv4_pdp_add(struct gtp_dev *gtp, struct genl_info *info)
>  	return 0;
>  }
>  
> +static void pdp_context_free(struct rcu_head *head)
> +{
> +	struct pdp_ctx *pctx = container_of(head, struct pdp_ctx, rcu_head);
> +
> +	sock_put(pctx->sk);
> +	kfree(pctx);
> +}
> +
>  static void pdp_context_delete(struct pdp_ctx *pctx)
>  {
>  	hlist_del_rcu(&pctx->hlist_tid);
>  	hlist_del_rcu(&pctx->hlist_addr);
> -	kfree(pctx);
> +	call_rcu(&pctx->rcu_head, pdp_context_free);

This is fixing incorrect rcu conversion in 4/6. Please, fix this there.



More information about the OpenBSC mailing list