Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Fix optlen calculation for the SACK block - 2 by...



details:   https://anonhg.NetBSD.org/src/rev/4b8592de6559
branches:  trunk
changeset: 820237:4b8592de6559
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jan 04 15:09:37 2017 +0000

description:
Fix optlen calculation for the SACK block - 2 bytes too few were
calculated, causing corruption in PR kern/51767.

diffstat:

 sys/netinet/tcp_output.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 378b034bd46c -r 4b8592de6559 sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c  Wed Jan 04 13:03:41 2017 +0000
+++ b/sys/netinet/tcp_output.c  Wed Jan 04 15:09:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_output.c,v 1.193 2017/01/04 12:35:14 kre Exp $     */
+/*     $NetBSD: tcp_output.c,v 1.194 2017/01/04 15:09:37 martin Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.193 2017/01/04 12:35:14 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.194 2017/01/04 15:09:37 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1267,7 +1267,7 @@
                                *lp++ = htonl(tiqe->ipqe_seq + tiqe->ipqe_len +
                                    ((tiqe->ipqe_flags & TH_FIN) != 0 ? 1 : 0));
                        }
-                       optlen += sack_len;
+                       optlen += sack_len + 2;
                        optp += sack_len;
                } else {
                        optp -= alen;



Home | Main Index | Thread Index | Old Index