Deleted Added
full compact
key.c (192882) key.c (193731)
1/* $FreeBSD: head/sys/netipsec/key.c 192882 2009-05-27 09:44:14Z vanhu $ */
1/* $FreeBSD: head/sys/netipsec/key.c 193731 2009-06-08 17:15:40Z zec $ */
2/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
3
4/*-
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 7208 unchanged lines hidden (view full) ---

7218#ifndef IPSEC_DEBUG2
7219 timeout((void *)key_timehandler, (void *)0, hz);
7220#endif /*IPSEC_DEBUG2*/
7221
7222 /* initialize key statistics */
7223 keystat.getspi_count = 1;
7224
7225 printf("IPsec: Initialized Security Association Processing.\n");
2/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
3
4/*-
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 7208 unchanged lines hidden (view full) ---

7218#ifndef IPSEC_DEBUG2
7219 timeout((void *)key_timehandler, (void *)0, hz);
7220#endif /*IPSEC_DEBUG2*/
7221
7222 /* initialize key statistics */
7223 keystat.getspi_count = 1;
7224
7225 printf("IPsec: Initialized Security Association Processing.\n");
7226}
7226
7227
7227 return;
7228#ifdef VIMAGE
7229void
7230key_destroy(void)
7231{
7232 INIT_VNET_IPSEC(curvnet);
7233 struct secpolicy *sp, *nextsp;
7234 struct secspacq *acq, *nextacq;
7235 struct secashead *sah, *nextsah;
7236 struct secreg *reg;
7237 int i;
7238
7239 SPTREE_LOCK();
7240 for (i = 0; i < IPSEC_DIR_MAX; i++) {
7241 for (sp = LIST_FIRST(&V_sptree[i]);
7242 sp != NULL; sp = nextsp) {
7243 nextsp = LIST_NEXT(sp, chain);
7244 if (__LIST_CHAINED(sp)) {
7245 LIST_REMOVE(sp, chain);
7246 free(sp, M_IPSEC_SP);
7247 }
7248 }
7249 }
7250 SPTREE_UNLOCK();
7251
7252 SAHTREE_LOCK();
7253 for (sah = LIST_FIRST(&V_sahtree); sah != NULL; sah = nextsah) {
7254 nextsah = LIST_NEXT(sah, chain);
7255 if (__LIST_CHAINED(sah)) {
7256 LIST_REMOVE(sah, chain);
7257 free(sah, M_IPSEC_SAH);
7258 }
7259 }
7260 SAHTREE_UNLOCK();
7261
7262 REGTREE_LOCK();
7263 for (i = 0; i <= SADB_SATYPE_MAX; i++) {
7264 LIST_FOREACH(reg, &V_regtree[i], chain) {
7265 if (__LIST_CHAINED(reg)) {
7266 LIST_REMOVE(reg, chain);
7267 free(reg, M_IPSEC_SAR);
7268 break;
7269 }
7270 }
7271 }
7272 REGTREE_UNLOCK();
7273
7274 ACQ_LOCK();
7275 for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) {
7276 nextacq = LIST_NEXT(acq, chain);
7277 if (__LIST_CHAINED(acq)) {
7278 LIST_REMOVE(acq, chain);
7279 free(acq, M_IPSEC_SAQ);
7280 }
7281 }
7282 ACQ_UNLOCK();
7283
7284 SPACQ_LOCK();
7285 for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) {
7286 nextacq = LIST_NEXT(acq, chain);
7287 if (__LIST_CHAINED(acq)) {
7288 LIST_REMOVE(acq, chain);
7289 free(acq, M_IPSEC_SAQ);
7290 }
7291 }
7292 SPACQ_UNLOCK();
7228}
7293}
7294#endif
7229
7230/*
7231 * XXX: maybe This function is called after INBOUND IPsec processing.
7232 *
7233 * Special check for tunnel-mode packets.
7234 * We must make some checks for consistency between inner and outer IP header.
7235 *
7236 * xxx more checks to be provided

--- 218 unchanged lines hidden ---
7295
7296/*
7297 * XXX: maybe This function is called after INBOUND IPsec processing.
7298 *
7299 * Special check for tunnel-mode packets.
7300 * We must make some checks for consistency between inner and outer IP header.
7301 *
7302 * xxx more checks to be provided

--- 218 unchanged lines hidden ---