lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 2 Feb 2017 15:19:51 +0100
From:   Pablo Neira Ayuso <pablo@...filter.org>
To:     Andreas Schultz <aschultz@...p.net>
Cc:     netdev@...r.kernel.org, Harald Welte <laforge@...monks.org>,
        Lionel Gauthier <Lionel.Gauthier@...ecom.fr>,
        openbsc@...ts.osmocom.org
Subject: Re: [PATCH net-next v2 3/6] gtp: unify genl_find_pdp and prepare for
 per socket lookup

On Mon, Jan 30, 2017 at 05:37:10PM +0100, Andreas Schultz wrote:
> This unifies duplicate code into a helper. It also prepares the
> groundwork to add a lookup version that uses the socket to find
> attache pdp contexts.
> 
> Signed-off-by: Andreas Schultz <aschultz@...p.net>
> ---
>  drivers/net/gtp.c | 120 +++++++++++++++++++++++-------------------------------
>  1 file changed, 51 insertions(+), 69 deletions(-)
> 
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index c96c71f..6b7a3c2 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
[...]
> +static struct pdp_ctx *gtp_genl_find_pdp(struct sk_buff *skb,
> +					 struct genl_info *info)
> +{
> +	struct pdp_ctx *pctx;
> +
> +	if (info->attrs[GTPA_LINK])
> +		pctx = gtp_genl_find_pdp_by_link(skb, info);
> +	else
> +		pctx = ERR_PTR(-EINVAL);
> +	if (!pctx)
> +		pctx = ERR_PTR(-ENOENT);
> +
> +	return pctx;
> +}

For gtp_genl_find_pdp(),  I think this is easier to read:

        if (!info->attrs[GTPA_LINK])
                return ERR_PTR(-EINVAL);

        pctx = gtp_genl_find_pdp_by_link(skb, info);
	if (!pctx)
		return ERR_PTR(-ENOENT);

        return pctx;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ