From owner-svn-src-head@FreeBSD.ORG Sat Nov 26 23:27:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA11D1065672; Sat, 26 Nov 2011 23:27:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D99808FC08; Sat, 26 Nov 2011 23:27:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNRfPP013058; Sat, 26 Nov 2011 23:27:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNRf4D013056; Sat, 26 Nov 2011 23:27:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111262327.pAQNRf4D013056@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Nov 2011 23:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228012 - head/sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:27:42 -0000 Author: pjd Date: Sat Nov 26 23:27:41 2011 New Revision: 228012 URL: http://svn.freebsd.org/changeset/base/228012 Log: The esp_max_ivlen global variable is not needed, we can just use EALG_MAX_BLOCK_LEN. Modified: head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Nov 26 23:18:19 2011 (r228011) +++ head/sys/netipsec/xform_esp.c Sat Nov 26 23:27:41 2011 (r228012) @@ -76,8 +76,6 @@ #include #include -static int esp_max_ivlen; /* max iv length over all algorithms */ - VNET_DEFINE(int, esp_enable) = 1; VNET_DEFINE(struct espstat, espstat); @@ -146,7 +144,7 @@ esp_hdrsiz(struct secasvar *sav) * + sizeof (next header field) * + max icv supported. */ - size = sizeof (struct newesp) + esp_max_ivlen + 9 + 16; + size = sizeof (struct newesp) + EALG_MAX_BLOCK_LEN + 9 + 16; } return size; } @@ -1020,20 +1018,7 @@ static struct xformsw esp_xformsw = { static void esp_attach(void) { -#define MAXIV(xform) \ - if (xform.blocksize > esp_max_ivlen) \ - esp_max_ivlen = xform.blocksize \ - - MAXIV(enc_xform_des); /* SADB_EALG_DESCBC */ - MAXIV(enc_xform_3des); /* SADB_EALG_3DESCBC */ - MAXIV(enc_xform_rijndael128); /* SADB_X_EALG_AES */ - MAXIV(enc_xform_blf); /* SADB_X_EALG_BLOWFISHCBC */ - MAXIV(enc_xform_cast5); /* SADB_X_EALG_CAST128CBC */ - MAXIV(enc_xform_skipjack); /* SADB_X_EALG_SKIPJACK */ - MAXIV(enc_xform_null); /* SADB_EALG_NULL */ - MAXIV(enc_xform_camellia); /* SADB_X_EALG_CAMELLIACBC */ xform_register(&esp_xformsw); -#undef MAXIV } SYSINIT(esp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, esp_attach, NULL);