Print this page
OS-5007 support SO_ATTACH_FILTER on ICMP sockets
Reviewed by: Cody Mello <melloc@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/rawip_impl.h
          +++ new/usr/src/uts/common/inet/rawip_impl.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright 2016 Joyent, Inc.
  23   24   */
  24   25  /* Copyright (c) 1990 Mentat Inc. */
  25   26  
  26   27  #ifndef _RAWIP_IMPL_H
  27   28  #define _RAWIP_IMPL_H
  28   29  
  29   30  #ifdef  __cplusplus
  30   31  extern "C" {
  31   32  #endif
  32   33  
↓ open down ↓ 3 lines elided ↑ open up ↑
  36   37  #include <sys/netstack.h>
  37   38  
  38   39  #include <netinet/in.h>
  39   40  #include <netinet/icmp6.h>
  40   41  #include <netinet/ip6.h>
  41   42  
  42   43  #include <inet/common.h>
  43   44  #include <inet/ip.h>
  44   45  #include <inet/optcom.h>
  45   46  #include <inet/tunables.h>
       47 +#include <inet/bpf.h>
  46   48  
  47   49  /*
  48   50   * ICMP stack instances
  49   51   */
  50   52  struct icmp_stack {
  51   53          netstack_t      *is_netstack;   /* Common netstack */
  52   54          void            *is_head;       /* Head for list of open icmps */
  53   55          mod_prop_info_t *is_propinfo_tbl; /* holds the icmp tunables */
  54   56          kstat_t         *is_ksp;        /* kstats */
  55   57          mib2_rawip_t    is_rawip_mib;   /* SNMP fixed size info */
↓ open down ↓ 21 lines elided ↑ open up ↑
  77   79          icmp6_filter_t  *icmp_filter;           /* ICMP6_FILTER option */
  78   80  
  79   81          /* Set at open time and never changed */
  80   82          icmp_stack_t    *icmp_is;               /* Stack instance */
  81   83  
  82   84          int             icmp_delayed_error;
  83   85          kmutex_t        icmp_recv_lock;
  84   86          mblk_t          *icmp_fallback_queue_head;
  85   87          mblk_t          *icmp_fallback_queue_tail;
  86   88          struct sockaddr_storage icmp_delayed_addr;
       89 +
       90 +        krwlock_t       icmp_bpf_lock;  /* protects icmp_bpf */
       91 +        ip_bpf_insn_t   *icmp_bpf_prog; /* SO_ATTACH_FILTER bpf */
       92 +        uint_t          icmp_bpf_len;
  87   93  } icmp_t;
  88   94  
  89   95  /*
  90   96   * Object to represent database of options to search passed to
  91   97   * {sock,tpi}optcom_req() interface routine to take care of option
  92   98   * management and associated methods.
  93   99   */
  94  100  extern optdb_obj_t      icmp_opt_obj;
  95  101  extern uint_t           icmp_max_optsize;
  96  102  
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX