Module Name: src
Committed By: ozaki-r
Date: Thu Jul 13 03:25:38 UTC 2017
Modified Files:
src/sys/netipsec: xform_ah.c
Log Message:
Fix header size calculation of ah in the case sav is NULL
This fix was also needed for esp.
To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/netipsec/xform_ah.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netipsec/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.58 src/sys/netipsec/xform_ah.c:1.59
--- src/sys/netipsec/xform_ah.c:1.58 Mon Jul 10 07:17:12 2017
+++ src/sys/netipsec/xform_ah.c Thu Jul 13 03:25:38 2017
@@ -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 @@ ah_hdrsiz(const struct secasvar *sav)
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;
}