Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec Fix header size calculation of ah in the case s...



details:   https://anonhg.NetBSD.org/src/rev/8e7d7283168b
branches:  trunk
changeset: 825403:8e7d7283168b
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Jul 13 03:25:38 2017 +0000

description:
Fix header size calculation of ah in the case sav is NULL

This fix was also needed for esp.

diffstat:

 sys/netipsec/xform_ah.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r b2f6e80d8573 -r 8e7d7283168b sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c   Thu Jul 13 03:00:46 2017 +0000
+++ b/sys/netipsec/xform_ah.c   Thu Jul 13 03:25:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform_ah.c,v 1.58 2017/07/10 07:17:12 ozaki-r Exp $    */
+/*     $NetBSD: xform_ah.c,v 1.59 2017/07/13 03:25:38 ozaki-r Exp $    */
 /*     $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $   */
 /*     $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.58 2017/07/10 07:17:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.59 2017/07/13 03:25:38 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -164,7 +164,8 @@
                size = roundup(authsize, sizeof(uint32_t)) + HDRSIZE(sav);
        } else {
                /* default guess */
-               size = sizeof(struct ah) + sizeof(uint32_t) + 16;
+               size = sizeof(struct ah) + sizeof(uint32_t) +
+                   32 /* XXX need to update when max authsize is changed */;
        }
        return size;
 }



Home | Main Index | Thread Index | Old Index