Print this page
8529 Extended and regular SADB_ACQUIREs should share address extension code
Portions contributed by: Bayard Bell <buffer.g.overflow@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/spd.c
          +++ new/usr/src/uts/common/inet/ip/spd.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   * Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
  25   25   * Copyright (c) 2016 by Delphix. All rights reserved.
       26 + * Copyright (c) 2017, Joyent, Inc.
  26   27   */
  27   28  
  28   29  /*
  29   30   * IPsec Security Policy Database.
  30   31   *
  31   32   * This module maintains the SPD and provides routines used by ip and ip6
  32   33   * to apply IPsec policy to inbound and outbound datagrams.
  33   34   */
  34   35  
  35   36  #include <sys/types.h>
↓ open down ↓ 4645 lines elided ↑ open up ↑
4681 4682          ipsec_stack_t   *ipss = ns->netstack_ipsec;
4682 4683  
4683 4684          for (i = 0; i < IPSID_HASHSIZE; i++) {
4684 4685                  bucket = &ipss->ipsec_ipsid_buckets[i];
4685 4686                  ASSERT(bucket->ipsif_head == NULL);
4686 4687                  mutex_destroy(&bucket->ipsif_lock);
4687 4688          }
4688 4689  }
4689 4690  
4690 4691  /*
4691      - * Update the minimum and maximum supported key sizes for the
4692      - * specified algorithm. Must be called while holding the algorithms lock.
     4692 + * Update the minimum and maximum supported key sizes for the specified
     4693 + * algorithm, which is either a member of a netstack alg array or about to be,
     4694 + * and therefore must be called holding ipsec_alg_lock for write.
4693 4695   */
4694 4696  void
4695 4697  ipsec_alg_fix_min_max(ipsec_alginfo_t *alg, ipsec_algtype_t alg_type,
4696 4698      netstack_t *ns)
4697 4699  {
4698 4700          size_t crypto_min = (size_t)-1, crypto_max = 0;
4699 4701          size_t cur_crypto_min, cur_crypto_max;
4700 4702          boolean_t is_valid;
4701 4703          crypto_mechanism_info_t *mech_infos;
4702 4704          uint_t nmech_infos;
↓ open down ↓ 2210 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX