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:	Mon, 2 May 2011 18:20:01 -0400
From:	Chris Metcalf <cmetcalf@...era.com>
To:	Shan Wei <shanwei@...fujitsu.com>
CC:	David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset
 to calculate offset

On 4/22/2011 7:07 AM, Shan Wei wrote:
> Although these are equivalent, but the skb_checksum_start_offset() is more readable.
>
>
> Signed-off-by: Shan Wei <shanwei@...fujitsu.com>
> ---
>  drivers/net/tile/tilepro.c |    2 +-
>  net/ipv6/udp.c             |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tile/tilepro.c b/drivers/net/tile/tilepro.c
> index 0825db6..1e980fd 100644
> --- a/drivers/net/tile/tilepro.c
> +++ b/drivers/net/tile/tilepro.c
> @@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
>  	unsigned int len = skb->len;
>  	unsigned char *data = skb->data;
>  
> -	unsigned int csum_start = skb->csum_start - skb_headroom(skb);
> +	unsigned int csum_start = skb_checksum_start_offset(skb);
>  
>  	lepp_frag_t frags[LEPP_MAX_FRAGS];
>  
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 15c3774..95c62a1 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
>  	/* Do software UFO. Complete and fill in the UDP checksum as HW cannot
>  	 * do checksum of UDP packets sent as multiple IP fragments.
>  	 */
> -	offset = skb->csum_start - skb_headroom(skb);
> +	offset = skb_checksum_start_offset(skb);
>  	csum = skb_checksum(skb, offset, skb->len- offset, 0);
>  	offset += skb->csum_offset;
>  	*(__sum16 *)(skb->data + offset) = csum_fold(csum);

I took the drivers/net/tile/ change into my tree, but I'll defer to David
or some other net person to take the net/ipv6/udp.c change.  Thanks!

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists