From f924be8731ff47fd43b26527154530f92cbbd9fb Mon Sep 17 00:00:00 2001 From: ozaki-r Date: Thu, 13 Jul 2017 03:00:46 +0000 Subject: [PATCH] Fix header size calculation of esp where sav is NULL --- sys/netipsec/xform_esp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 9783db6dd825..6cc99302c1d6 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -1,4 +1,4 @@ -/* $NetBSD: xform_esp.c,v 1.59 2017/07/10 07:17:12 ozaki-r Exp $ */ +/* $NetBSD: xform_esp.c,v 1.60 2017/07/13 03:00:46 ozaki-r Exp $ */ /* $FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $ */ /* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */ @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.59 2017/07/10 07:17:12 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.60 2017/07/13 03:00:46 ozaki-r Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -163,7 +163,8 @@ esp_hdrsiz(const struct secasvar *sav) * + sizeof(next header field) * + max icv supported. */ - size = sizeof(struct newesp) + esp_max_ivlen + 9 + 16; + size = sizeof(struct newesp) + esp_max_ivlen + 9 + + ah_hdrsiz(NULL); } return size; }