Print this page
8927 sadb_x_kmc_t's KM cookie should be 64-bits
Reviewed by: Jason King <jason.king@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/net/pfkeyv2.h
          +++ new/usr/src/uts/common/net/pfkeyv2.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
       25 +/*
       26 + * Copyright 2017 Joyent, Inc.
       27 + */
  25   28  
  26   29  #ifndef _NET_PFKEYV2_H
  27   30  #define _NET_PFKEYV2_H
  28   31  
  29   32  /*
  30   33   * Definitions and structures for PF_KEY version 2.  See RFC 2367 for
  31   34   * more details.  SA == Security Association, which is what PF_KEY provides
  32   35   * an API for managing.
  33   36   */
  34   37  
↓ open down ↓ 435 lines elided ↑ open up ↑
 470  473  
 471  474  typedef struct sadb_x_kmc {
 472  475          uint16_t sadb_x_kmc_len;
 473  476          uint16_t sadb_x_kmc_exttype;    /* X_KM_COOKIE */
 474  477          uint32_t sadb_x_kmc_proto;      /* KM protocol */
 475  478          union {
 476  479                  struct {
 477  480                          uint32_t sadb_x_kmc_ucookie;    /* KMP-specific */
 478  481                          uint32_t sadb_x_kmc_ureserved;  /* Must be zero */
 479  482                  } sadb_x_kmc_actual;
 480      -                uint64_t sadb_x_kmc_alignment;
      483 +                uint64_t sadb_x_kmc_ucookie64;
 481  484          } sadb_x_kmc_u;
 482  485  #define sadb_x_kmc_cookie sadb_x_kmc_u.sadb_x_kmc_actual.sadb_x_kmc_ucookie
 483  486  #define sadb_x_kmc_reserved sadb_x_kmc_u.sadb_x_kmc_actual.sadb_x_kmc_ureserved
      487 +#define sadb_x_kmc_cookie64 sadb_x_kmc_u.sadb_x_kmc_ucookie64
 484  488  } sadb_x_kmc_t;
 485  489  
 486  490  typedef struct sadb_x_pair {
 487  491          union {
 488  492                  /* Union is for guaranteeing 64-bit alignment. */
 489  493                  struct {
 490  494                          uint16_t sadb_x_pair_ulen;
 491  495                          uint16_t sadb_x_pair_uexttype;
 492  496                          uint32_t sadb_x_pair_uspi;      /* SPI of paired SA */
 493  497                  } sadb_x_pair_actual;
↓ open down ↓ 333 lines elided ↑ open up ↑
 827  831  
 828  832  #define SADB_X_ALGTYPE_NONE             0
 829  833  #define SADB_X_ALGTYPE_AUTH             1
 830  834  #define SADB_X_ALGTYPE_CRYPT            2
 831  835  #define SADB_X_ALGTYPE_COMPRESS         3
 832  836  
 833  837  #define SADB_X_ALGTYPE_MAX              3
 834  838  
 835  839  /* Key management protocol for sadb_x_kmc above... */
 836  840  
 837      -#define SADB_X_KMP_MANUAL       0
      841 +#define SADB_X_KMP_MANUAL       0       /* Cookie is ignored. */
 838  842  #define SADB_X_KMP_IKE          1
 839  843  #define SADB_X_KMP_KINK         2
 840  844  
 841  845  #define SADB_X_KMP_MAX          2
 842  846  
 843  847  /*
 844  848   * Handy conversion macros.  Not part of the PF_KEY spec...
 845  849   */
 846  850  
 847  851  #define SADB_64TO8(x)   ((x) << 3)
 848  852  #define SADB_8TO64(x)   ((x) >> 3)
 849  853  #define SADB_8TO1(x)    ((x) << 3)
 850  854  #define SADB_1TO8(x)    ((x) >> 3)
 851  855  
 852  856  #ifdef  __cplusplus
 853  857  }
 854  858  #endif
 855  859  
 856  860  #endif  /* _NET_PFKEYV2_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX