netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: bcrl@kvack.org
Cc: netdev@vger.kernel.org, jchapman@katalix.com
Subject: Re: [PATCH 4/4] net/l2tp: add support for L2TP over IPv6 UDP encap
Date: Wed, 18 Apr 2012 14:30:57 -0400 (EDT)	[thread overview]
Message-ID: <20120418.143057.38880609278817544.davem@davemloft.net> (raw)
In-Reply-To: <20120418134438.GA5162@kvack.org>

From: Benjamin LaHaise <bcrl@kvack.org>
Date: Wed, 18 Apr 2012 09:44:38 -0400

> +#if IS_ENABLED(CONFIG_IPV6)
> +	if (sk->sk_family == PF_INET6) {
> +		if (!uh->check) {
> +			LIMIT_NETDEBUG(KERN_INFO "L2TP: IPv6: checksum is 0\n");
> +			return 1;
> +		}
> +		if ((skb->ip_summed == CHECKSUM_COMPLETE) &&
> +		    !csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
> +				     &ipv6_hdr(skb)->daddr, ulen,
> +				     IPPROTO_UDP, skb->csum)) {
> +			skb->ip_summed = CHECKSUM_UNNECESSARY;
> +			return 0;
> +		}
> +		skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
> +							 &ipv6_hdr(skb)->daddr,
> +							 skb->len, IPPROTO_UDP,
> +							 0));

Both the csum_ipv6_magic() calls should either use "ulen" or both
should use "skb->len".

      parent reply	other threads:[~2012-04-18 18:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 13:44 [PATCH 4/4] net/l2tp: add support for L2TP over IPv6 UDP encap Benjamin LaHaise
2012-04-18 15:36 ` James Chapman
2012-04-18 18:30 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120418.143057.38880609278817544.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bcrl@kvack.org \
    --cc=jchapman@katalix.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).