Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 avoid hardcoded "16" for max AH sum size. use ...
details: https://anonhg.NetBSD.org/src/rev/4beceb0236b2
branches: trunk
changeset: 535061:4beceb0236b2
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Aug 09 07:01:21 2002 +0000
description:
avoid hardcoded "16" for max AH sum size. use AH_MAXSUMSIZE.
diffstat:
sys/netinet6/ah_output.c | 8 ++++----
sys/netinet6/esp_output.c | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diffs (64 lines):
diff -r a4a42f53ebf1 -r 4beceb0236b2 sys/netinet6/ah_output.c
--- a/sys/netinet6/ah_output.c Fri Aug 09 06:38:12 2002 +0000
+++ b/sys/netinet6/ah_output.c Fri Aug 09 07:01:21 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ah_output.c,v 1.17 2002/06/09 14:43:11 itojun Exp $ */
+/* $NetBSD: ah_output.c,v 1.18 2002/08/09 07:01:21 itojun Exp $ */
/* $KAME: ah_output.c,v 1.31 2001/07/26 06:53:15 jinmei Exp $ */
/*
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ah_output.c,v 1.17 2002/06/09 14:43:11 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ah_output.c,v 1.18 2002/08/09 07:01:21 itojun Exp $");
#include "opt_inet.h"
@@ -126,9 +126,9 @@
estimate:
/* ASSUMING:
* sizeof(struct newah) > sizeof(struct ah).
- * 16 = (16 + 3) & ~(4 - 1).
+ * AH_MAXSUMSIZE is multiple of 4.
*/
- return sizeof(struct newah) + 16;
+ return sizeof(struct newah) + AH_MAXSUMSIZE;
}
#ifdef INET
diff -r a4a42f53ebf1 -r 4beceb0236b2 sys/netinet6/esp_output.c
--- a/sys/netinet6/esp_output.c Fri Aug 09 06:38:12 2002 +0000
+++ b/sys/netinet6/esp_output.c Fri Aug 09 07:01:21 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: esp_output.c,v 1.14 2002/08/09 06:38:14 itojun Exp $ */
+/* $NetBSD: esp_output.c,v 1.15 2002/08/09 07:01:21 itojun Exp $ */
/* $KAME: esp_output.c,v 1.44 2001/07/26 06:53:15 jinmei Exp $ */
/*
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp_output.c,v 1.14 2002/08/09 06:38:14 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp_output.c,v 1.15 2002/08/09 07:01:21 itojun Exp $");
#include "opt_inet.h"
@@ -144,12 +144,12 @@
* sizeof(struct newesp) > sizeof(struct esp).
* esp_max_ivlen() = max ivlen for CBC mode
* esp_max_padbound - 1 =
- * (maximum padding length without random padding length)
+ * maximum padding length without random padding length
* 2 = (Pad Length field) + (Next Header field).
- * 16 = maximum ICV we support.
+ * AH_MAXSUMSIZE = maximum ICV we support.
*/
return sizeof(struct newesp) + esp_max_ivlen() +
- esp_max_padbound() - 1 + 2 + 16;
+ esp_max_padbound() - 1 + 2 + AH_MAXSUMSIZE;
}
/*
Home |
Main Index |
Thread Index |
Old Index