diff options
Diffstat (limited to 'sys/netipsec/xform_esp.c')
-rw-r--r-- | sys/netipsec/xform_esp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 98a2240..46ab8d8 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -90,6 +90,7 @@ SYSCTL_V_STRUCT(V_NET, vnet_ipsec, _net_inet_esp, IPSECCTL_STATS, static int esp_input_cb(struct cryptop *op); static int esp_output_cb(struct cryptop *crp); +static int esp_iattach(const void *); /* * NB: this is public for use by the PF_KEY support. @@ -990,9 +991,19 @@ static struct xformsw esp_xformsw = { static void esp_attach(void) { + + xform_register(&esp_xformsw); + esp_iattach(NULL); +} + +static int +esp_iattach(const void *unused __unused) +{ + INIT_VNET_IPSEC(curvnet); + #define MAXIV(xform) \ if (xform.blocksize > V_esp_max_ivlen) \ - V_esp_max_ivlen = xform.blocksize \ + V_esp_max_ivlen = xform.blocksize \ V_esp_enable = 1; V_esp_max_ivlen = 0; @@ -1005,8 +1016,8 @@ esp_attach(void) 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 + + return (0); } SYSINIT(esp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, esp_attach, NULL); |