Index | Thread | Search

From:
Alexandr Nedvedicky <sashan@fastmail.net>
Subject:
Re: Bug or feature? TCP chksum fails when IPv6 packet carries ext. headers
To:
Alexander Bluhm <bluhm@openbsd.org>
Cc:
Giovanni Pimpinella <pimpinella@di.uniroma1.it>, tech@openbsd.org
Date:
Fri, 28 Feb 2025 23:58:57 +0100

Download raw body.

Thread
Hello,

On Fri, Feb 28, 2025 at 10:33:53PM +0100, Alexander Bluhm wrote:
</snip>
> 
> Anyway, this is a bug.  I will commit the diff below.  I just fixed
> the formating.
> 

    diff makes sense to me.

OK sashan

> bluhm
> 
> Index: netinet/tcp_input.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/tcp_input.c,v
> diff -u -p -r1.431 tcp_input.c
> --- netinet/tcp_input.c	17 Feb 2025 08:56:33 -0000	1.431
> +++ netinet/tcp_input.c	28 Feb 2025 20:47:37 -0000
> @@ -469,8 +469,7 @@ tcp_input(struct mbuf **mp, int *offp, i
>  			break;
>  #ifdef INET6
>  		case AF_INET6:
> -			sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr),
> -			    tlen);
> +			sum = in6_cksum(m, IPPROTO_TCP, iphlen, tlen);
>  			break;
>  #endif
>  		}
>