[BACK]Return to ip_input.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / netinet

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/netinet/ip_input.c between version 1.307.2.3 and 1.308

version 1.307.2.3, 2014/05/18 17:46:13 version 1.308, 2013/06/29 21:06:58
Line 212  int ip_do_randomid = 0;
Line 212  int ip_do_randomid = 0;
  */   */
 int     ip_checkinterface = 0;  int     ip_checkinterface = 0;
   
   
 struct rttimer_queue *ip_mtudisc_timeout_q = NULL;  struct rttimer_queue *ip_mtudisc_timeout_q = NULL;
   
   u_long  in_ifaddrhash;                          /* size of hash table - 1 */
   int     in_ifaddrentries;                       /* total number of addrs */
   struct in_ifaddrhead in_ifaddrhead;
   struct  in_ifaddrhashhead *in_ifaddrhashtbl;
   u_long  in_multihash;                           /* size of hash table - 1 */
   int     in_multientries;                        /* total number of addrs */
   struct  in_multihashhead *in_multihashtbl;
 struct  ifqueue ipintrq;  struct  ifqueue ipintrq;
   
 ipid_state_t *          ip_ids;  ipid_state_t *          ip_ids;
Line 223  percpu_t *ipstat_percpu;
Line 231  percpu_t *ipstat_percpu;
   
 pfil_head_t *inet_pfil_hook;  pfil_head_t *inet_pfil_hook;
   
   struct pool inmulti_pool;
   
 #ifdef INET_CSUM_COUNTERS  #ifdef INET_CSUM_COUNTERS
 #include <sys/device.h>  #include <sys/device.h>
   
Line 252  EVCNT_ATTACH_STATIC(ip_swcsum);
Line 262  EVCNT_ATTACH_STATIC(ip_swcsum);
  * maintenance when the remote end is on a network that is not known   * maintenance when the remote end is on a network that is not known
  * to us.   * to us.
  */   */
   int     ip_nhops = 0;
 static int      ip_nhops = 0;  
   
 static  struct ip_srcrt {  static  struct ip_srcrt {
         struct  in_addr dst;                    /* final destination */          struct  in_addr dst;                    /* final destination */
         char    nop;                            /* one NOP to align */          char    nop;                            /* one NOP to align */
Line 271  struct mowner ip_rx_mowner = MOWNER_INIT
Line 279  struct mowner ip_rx_mowner = MOWNER_INIT
 struct mowner ip_tx_mowner = MOWNER_INIT("internet", "tx");  struct mowner ip_tx_mowner = MOWNER_INIT("internet", "tx");
 #endif  #endif
   
 static bool             ip_dooptions(struct mbuf *);  static void sysctl_net_inet_ip_setup(struct sysctllog **);
 static struct in_ifaddr *ip_rtaddr(struct in_addr);  
 static void             sysctl_net_inet_ip_setup(struct sysctllog **);  
   
 /*  /*
  * IP initialization: fill in IP protocol switch table.   * IP initialization: fill in IP protocol switch table.
Line 283  void
Line 289  void
 ip_init(void)  ip_init(void)
 {  {
         const struct protosw *pr;          const struct protosw *pr;
           int i;
   
         in_init();  
         sysctl_net_inet_ip_setup(NULL);          sysctl_net_inet_ip_setup(NULL);
   
         pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);          pool_init(&inmulti_pool, sizeof(struct in_multi), 0, 0, 0, "inmltpl",
         KASSERT(pr != NULL);              NULL, IPL_SOFTNET);
   
         for (u_int i = 0; i < IPPROTO_MAX; i++) {          pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW);
           if (pr == 0)
                   panic("ip_init");
           for (i = 0; i < IPPROTO_MAX; i++)
                 ip_protox[i] = pr - inetsw;                  ip_protox[i] = pr - inetsw;
         }  
         for (pr = inetdomain.dom_protosw;          for (pr = inetdomain.dom_protosw;
             pr < inetdomain.dom_protoswNPROTOSW; pr++)              pr < inetdomain.dom_protoswNPROTOSW; pr++)
                 if (pr->pr_domain->dom_family == PF_INET &&                  if (pr->pr_domain->dom_family == PF_INET &&
Line 306  ip_init(void)
Line 314  ip_init(void)
   
         ipintrq.ifq_maxlen = IFQ_MAXLEN;          ipintrq.ifq_maxlen = IFQ_MAXLEN;
   
           TAILQ_INIT(&in_ifaddrhead);
           in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true,
               &in_ifaddrhash);
           in_multihashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true,
               &in_multihash);
         ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout);          ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout);
 #ifdef GATEWAY  #ifdef GATEWAY
         ipflow_init();          ipflow_init(ip_hashsize);
 #endif  #endif
   
         /* Register our Packet Filter hook. */          /* Register our Packet Filter hook. */
Line 327  struct sockaddr_in ipaddr = {
Line 340  struct sockaddr_in ipaddr = {
         .sin_len = sizeof(ipaddr),          .sin_len = sizeof(ipaddr),
         .sin_family = AF_INET,          .sin_family = AF_INET,
 };  };
   struct  route ipforward_rt;
 static struct route     ipforward_rt;  
   
 /*  /*
  * IP software interrupt routine   * IP software interrupt routine
Line 802  ip_drain(void)
Line 814  ip_drain(void)
 }  }
   
 /*  /*
  * ip_dooptions: perform option processing on a datagram, possibly discarding   * Do option processing on a datagram,
  * it if bad options are encountered, or forwarding it if source-routed.   * possibly discarding it if bad options are encountered,
  *   * or forwarding it if source-routed.
  * => Returns true if packet has been forwarded/freed.   * Returns 1 if packet has been forwarded/freed,
  * => Returns false if the packet should be processed further.   * 0 if the packet should be processed further.
  */   */
 static bool  int
 ip_dooptions(struct mbuf *m)  ip_dooptions(struct mbuf *m)
 {  {
         struct ip *ip = mtod(m, struct ip *);          struct ip *ip = mtod(m, struct ip *);
Line 1024  ip_dooptions(struct mbuf *m)
Line 1036  ip_dooptions(struct mbuf *m)
                         goto bad;                          goto bad;
                 }                  }
                 ip_forward(m, 1);                  ip_forward(m, 1);
                 return true;                  return (1);
         }          }
         return false;          return (0);
 bad:  bad:
         icmp_error(m, type, code, 0, 0);          icmp_error(m, type, code, 0, 0);
         IP_STATINC(IP_STAT_BADOPTIONS);          IP_STATINC(IP_STAT_BADOPTIONS);
         return true;          return (1);
 }  }
   
 /*  /*
  * ip_rtaddr: given address of next destination (final or next hop),   * Given address of next destination (final or next hop),
  * return internet address info of interface to be used to get there.   * return internet address info of interface to be used to get there.
  */   */
 static struct in_ifaddr *  struct in_ifaddr *
 ip_rtaddr(struct in_addr dst)  ip_rtaddr(struct in_addr dst)
 {  {
         struct rtentry *rt;          struct rtentry *rt;
Line 1055  ip_rtaddr(struct in_addr dst)
Line 1067  ip_rtaddr(struct in_addr dst)
 }  }
   
 /*  /*
  * save_rte: save incoming source route for use in replies, to be picked   * Save incoming source route for use in replies,
  * up later by ip_srcroute if the receiver is interested.   * to be picked up later by ip_srcroute if the receiver is interested.
  */   */
 static void  void
 save_rte(u_char *option, struct in_addr dst)  save_rte(u_char *option, struct in_addr dst)
 {  {
         unsigned olen;          unsigned olen;
   
         olen = option[IPOPT_OLEN];          olen = option[IPOPT_OLEN];
   #ifdef DIAGNOSTIC
           if (ipprintfs)
                   printf("save_rte: olen %d\n", olen);
   #endif /* 0 */
         if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst)))          if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst)))
                 return;                  return;
         memcpy((void *)ip_srcrt.srcopt, (void *)option, olen);          memcpy((void *)ip_srcrt.srcopt, (void *)option, olen);
Line 1094  ip_srcroute(void)
Line 1110  ip_srcroute(void)
         /* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */          /* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */
         m->m_len = ip_nhops * sizeof(struct in_addr) + sizeof(struct in_addr) +          m->m_len = ip_nhops * sizeof(struct in_addr) + sizeof(struct in_addr) +
             OPTSIZ;              OPTSIZ;
   #ifdef DIAGNOSTIC
           if (ipprintfs)
                   printf("ip_srcroute: nhops %d mlen %d", ip_nhops, m->m_len);
   #endif
   
         /*          /*
          * First save first hop for return route           * First save first hop for return route
          */           */
         p = &ip_srcrt.route[ip_nhops - 1];          p = &ip_srcrt.route[ip_nhops - 1];
         *(mtod(m, struct in_addr *)) = *p--;          *(mtod(m, struct in_addr *)) = *p--;
   #ifdef DIAGNOSTIC
           if (ipprintfs)
                   printf(" hops %x", ntohl(mtod(m, struct in_addr *)->s_addr));
   #endif
   
         /*          /*
          * Copy option fields and padding (nop) to mbuf.           * Copy option fields and padding (nop) to mbuf.
Line 1116  ip_srcroute(void)
Line 1140  ip_srcroute(void)
          * reversing the path (pointers are now aligned).           * reversing the path (pointers are now aligned).
          */           */
         while (p >= ip_srcrt.route) {          while (p >= ip_srcrt.route) {
   #ifdef DIAGNOSTIC
                   if (ipprintfs)
                           printf(" %x", ntohl(q->s_addr));
   #endif
                 *q++ = *p--;                  *q++ = *p--;
         }          }
         /*          /*
          * Last hop goes to final destination.           * Last hop goes to final destination.
          */           */
         *q = ip_srcrt.dst;          *q = ip_srcrt.dst;
   #ifdef DIAGNOSTIC
           if (ipprintfs)
                   printf(" %x\n", ntohl(q->s_addr));
   #endif
         return (m);          return (m);
 }  }
   
Line 1190  ip_forward(struct mbuf *m, int srcrt)
Line 1222  ip_forward(struct mbuf *m, int srcrt)
         m->m_pkthdr.csum_flags = 0;          m->m_pkthdr.csum_flags = 0;
   
         dest = 0;          dest = 0;
   #ifdef DIAGNOSTIC
           if (ipprintfs) {
                   printf("forward: src %s ", inet_ntoa(ip->ip_src));
                   printf("dst %s ttl %x\n", inet_ntoa(ip->ip_dst), ip->ip_ttl);
           }
   #endif
         if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) {          if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) {
                 IP_STATINC(IP_STAT_CANTFORWARD);                  IP_STATINC(IP_STAT_CANTFORWARD);
                 m_freem(m);                  m_freem(m);
Line 1242  ip_forward(struct mbuf *m, int srcrt)
Line 1280  ip_forward(struct mbuf *m, int srcrt)
                          */                           */
                         type = ICMP_REDIRECT;                          type = ICMP_REDIRECT;
                         code = ICMP_REDIRECT_HOST;                          code = ICMP_REDIRECT_HOST;
   #ifdef DIAGNOSTIC
                           if (ipprintfs)
                                   printf("redirect (%d) to %x\n", code,
                                       (u_int32_t)dest);
   #endif
                 }                  }
         }          }
   
Line 1300  ip_forward(struct mbuf *m, int srcrt)
Line 1343  ip_forward(struct mbuf *m, int srcrt)
                 break;                  break;
   
         case ENOBUFS:          case ENOBUFS:
   #if 1
                 /*                  /*
                  * Do not generate ICMP_SOURCEQUENCH as required in RFC 1812,                   * a router should not generate ICMP_SOURCEQUENCH as
                  * Requirements for IP Version 4 Routers.  Source quench can                   * required in RFC1812 Requirements for IP Version 4 Routers.
                  * big problem under DoS attacks or if the underlying                   * source quench could be a big problem under DoS attacks,
                  * interface is rate-limited.                   * or if the underlying interface is rate-limited.
                  */                   */
                 if (mcopy)                  if (mcopy)
                         m_freem(mcopy);                          m_freem(mcopy);
                 return;                  return;
   #else
                   type = ICMP_SOURCEQUENCH;
                   code = 0;
                   break;
   #endif
         }          }
         icmp_error(mcopy, type, code, dest, destmtu);          icmp_error(mcopy, type, code, dest, destmtu);
 }  }
   
 void  void
 ip_savecontrol(inpcb_t *inp, struct mbuf **mp, struct ip *ip, struct mbuf *m)  ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
       struct mbuf *m)
 {  {
         struct socket *so = inpcb_get_socket(inp);  
         int inpflags = inpcb_get_flags(inp);  
   
         if (so->so_options & SO_TIMESTAMP          if (inp->inp_socket->so_options & SO_TIMESTAMP
 #ifdef SO_OTIMESTAMP  #ifdef SO_OTIMESTAMP
             || so->so_options & SO_OTIMESTAMP              || inp->inp_socket->so_options & SO_OTIMESTAMP
 #endif  #endif
             ) {              ) {
                 struct timeval tv;                  struct timeval tv;
   
                 microtime(&tv);                  microtime(&tv);
 #ifdef SO_OTIMESTAMP  #ifdef SO_OTIMESTAMP
                 if (so->so_options & SO_OTIMESTAMP) {                  if (inp->inp_socket->so_options & SO_OTIMESTAMP) {
                         struct timeval50 tv50;                          struct timeval50 tv50;
                         timeval_to_timeval50(&tv, &tv50);                          timeval_to_timeval50(&tv, &tv50);
                         *mp = sbcreatecontrol((void *) &tv50, sizeof(tv50),                          *mp = sbcreatecontrol((void *) &tv50, sizeof(tv50),
Line 1340  ip_savecontrol(inpcb_t *inp, struct mbuf
Line 1388  ip_savecontrol(inpcb_t *inp, struct mbuf
                 if (*mp)                  if (*mp)
                         mp = &(*mp)->m_next;                          mp = &(*mp)->m_next;
         }          }
         if (inpflags & INP_RECVDSTADDR) {          if (inp->inp_flags & INP_RECVDSTADDR) {
                 *mp = sbcreatecontrol((void *) &ip->ip_dst,                  *mp = sbcreatecontrol((void *) &ip->ip_dst,
                     sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP);                      sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP);
                 if (*mp)                  if (*mp)
                         mp = &(*mp)->m_next;                          mp = &(*mp)->m_next;
         }          }
         if (inpflags & INP_RECVPKTINFO) {          if (inp->inp_flags & INP_RECVPKTINFO) {
                 struct in_pktinfo ipi;                  struct in_pktinfo ipi;
                 ipi.ipi_addr = ip->ip_src;                  ipi.ipi_addr = ip->ip_src;
                 ipi.ipi_ifindex = m->m_pkthdr.rcvif->if_index;                  ipi.ipi_ifindex = m->m_pkthdr.rcvif->if_index;
Line 1355  ip_savecontrol(inpcb_t *inp, struct mbuf
Line 1403  ip_savecontrol(inpcb_t *inp, struct mbuf
                 if (*mp)                  if (*mp)
                         mp = &(*mp)->m_next;                          mp = &(*mp)->m_next;
         }          }
         if (inpflags & INP_PKTINFO) {          if (inp->inp_flags & INP_PKTINFO) {
                 struct in_pktinfo ipi;                  struct in_pktinfo ipi;
                 ipi.ipi_addr = ip->ip_dst;                  ipi.ipi_addr = ip->ip_dst;
                 ipi.ipi_ifindex = m->m_pkthdr.rcvif->if_index;                  ipi.ipi_ifindex = m->m_pkthdr.rcvif->if_index;
Line 1364  ip_savecontrol(inpcb_t *inp, struct mbuf
Line 1412  ip_savecontrol(inpcb_t *inp, struct mbuf
                 if (*mp)                  if (*mp)
                         mp = &(*mp)->m_next;                          mp = &(*mp)->m_next;
         }          }
         if (inpflags & INP_RECVIF) {  #ifdef notyet
           /*
            * XXX
            * Moving these out of udp_input() made them even more broken
            * than they already were.
            *      - fenner@parc.xerox.com
            */
           /* options were tossed already */
           if (inp->inp_flags & INP_RECVOPTS) {
                   *mp = sbcreatecontrol((void *) opts_deleted_above,
                       sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP);
                   if (*mp)
                           mp = &(*mp)->m_next;
           }
           /* ip_srcroute doesn't do what we want here, need to fix */
           if (inp->inp_flags & INP_RECVRETOPTS) {
                   *mp = sbcreatecontrol((void *) ip_srcroute(),
                       sizeof(struct in_addr), IP_RECVRETOPTS, IPPROTO_IP);
                   if (*mp)
                           mp = &(*mp)->m_next;
           }
   #endif
           if (inp->inp_flags & INP_RECVIF) {
                 struct sockaddr_dl sdl;                  struct sockaddr_dl sdl;
   
                 sockaddr_dl_init(&sdl, sizeof(sdl), m->m_pkthdr.rcvif ?                  sockaddr_dl_init(&sdl, sizeof(sdl),
                     m->m_pkthdr.rcvif->if_index : 0, 0, NULL, 0, NULL, 0);                      (m->m_pkthdr.rcvif != NULL)
                           ?  m->m_pkthdr.rcvif->if_index
                           : 0,
                           0, NULL, 0, NULL, 0);
                 *mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP);                  *mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP);
                 if (*mp)                  if (*mp)
                         mp = &(*mp)->m_next;                          mp = &(*mp)->m_next;
         }          }
         if (inpflags & INP_RECVTTL) {          if (inp->inp_flags & INP_RECVTTL) {
                 *mp = sbcreatecontrol((void *) &ip->ip_ttl,                  *mp = sbcreatecontrol((void *) &ip->ip_ttl,
                     sizeof(uint8_t), IP_RECVTTL, IPPROTO_IP);                      sizeof(uint8_t), IP_RECVTTL, IPPROTO_IP);
                 if (*mp)                  if (*mp)
Line 1436  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
Line 1509  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
         return (0);          return (0);
 }  }
   
   #ifdef GATEWAY
   /*
    * sysctl helper routine for net.inet.ip.maxflows.
    */
   static int
   sysctl_net_inet_ip_maxflows(SYSCTLFN_ARGS)
   {
           int error;
   
           error = sysctl_lookup(SYSCTLFN_CALL(rnode));
           if (error || newp == NULL)
                   return (error);
   
           mutex_enter(softnet_lock);
           KERNEL_LOCK(1, NULL);
   
           ipflow_prune();
   
           KERNEL_UNLOCK_ONE(NULL);
           mutex_exit(softnet_lock);
   
           return (0);
   }
   
   static int
   sysctl_net_inet_ip_hashsize(SYSCTLFN_ARGS)
   {
           int error, tmp;
           struct sysctlnode node;
   
           node = *rnode;
           tmp = ip_hashsize;
           node.sysctl_data = &tmp;
           error = sysctl_lookup(SYSCTLFN_CALL(&node));
           if (error || newp == NULL)
                   return (error);
   
           if ((tmp & (tmp - 1)) == 0 && tmp != 0) {
                   /*
                    * Can only fail due to malloc()
                    */
                   mutex_enter(softnet_lock);
                   KERNEL_LOCK(1, NULL);
   
                   error = ipflow_invalidate_all(tmp);
   
                   KERNEL_UNLOCK_ONE(NULL);
                   mutex_exit(softnet_lock);
   
           } else {
                   /*
                    * EINVAL if not a power of 2
                    */
                   error = EINVAL;
           }
   
           return error;
   }
   #endif /* GATEWAY */
   
 static int  static int
 sysctl_net_inet_ip_stats(SYSCTLFN_ARGS)  sysctl_net_inet_ip_stats(SYSCTLFN_ARGS)
 {  {
Line 1446  sysctl_net_inet_ip_stats(SYSCTLFN_ARGS)
Line 1579  sysctl_net_inet_ip_stats(SYSCTLFN_ARGS)
 static void  static void
 sysctl_net_inet_ip_setup(struct sysctllog **clog)  sysctl_net_inet_ip_setup(struct sysctllog **clog)
 {  {
           extern int subnetsarelocal, hostzeroisbroadcast;
   
           sysctl_createv(clog, 0, NULL, NULL,
                          CTLFLAG_PERMANENT,
                          CTLTYPE_NODE, "net", NULL,
                          NULL, 0, NULL, 0,
                          CTL_NET, CTL_EOL);
         sysctl_createv(clog, 0, NULL, NULL,          sysctl_createv(clog, 0, NULL, NULL,
                        CTLFLAG_PERMANENT,                         CTLFLAG_PERMANENT,
                        CTLTYPE_NODE, "inet",                         CTLTYPE_NODE, "inet",
Line 1511  sysctl_net_inet_ip_setup(struct sysctllo
Line 1651  sysctl_net_inet_ip_setup(struct sysctllo
                        NULL, 0, &ip_allowsrcrt, 0,                         NULL, 0, &ip_allowsrcrt, 0,
                        CTL_NET, PF_INET, IPPROTO_IP,                         CTL_NET, PF_INET, IPPROTO_IP,
                        IPCTL_ALLOWSRCRT, CTL_EOL);                         IPCTL_ALLOWSRCRT, CTL_EOL);
           sysctl_createv(clog, 0, NULL, NULL,
                          CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                          CTLTYPE_INT, "subnetsarelocal",
                          SYSCTL_DESCR("Whether logical subnets are considered "
                                       "local"),
                          NULL, 0, &subnetsarelocal, 0,
                          CTL_NET, PF_INET, IPPROTO_IP,
                          IPCTL_SUBNETSARELOCAL, CTL_EOL);
         sysctl_createv(clog, 0, NULL, NULL,          sysctl_createv(clog, 0, NULL, NULL,
                        CTLFLAG_PERMANENT|CTLFLAG_READWRITE,                         CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                        CTLTYPE_INT, "mtudisc",                         CTLTYPE_INT, "mtudisc",
Line 1540  sysctl_net_inet_ip_setup(struct sysctllo
Line 1687  sysctl_net_inet_ip_setup(struct sysctllo
                        sysctl_net_inet_ip_pmtudto, 0, (void *)&ip_mtudisc_timeout, 0,                         sysctl_net_inet_ip_pmtudto, 0, (void *)&ip_mtudisc_timeout, 0,
                        CTL_NET, PF_INET, IPPROTO_IP,                         CTL_NET, PF_INET, IPPROTO_IP,
                        IPCTL_MTUDISCTIMEOUT, CTL_EOL);                         IPCTL_MTUDISCTIMEOUT, CTL_EOL);
   #ifdef GATEWAY
           sysctl_createv(clog, 0, NULL, NULL,
                          CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                          CTLTYPE_INT, "maxflows",
                          SYSCTL_DESCR("Number of flows for fast forwarding"),
                          sysctl_net_inet_ip_maxflows, 0, &ip_maxflows, 0,
                          CTL_NET, PF_INET, IPPROTO_IP,
                          IPCTL_MAXFLOWS, CTL_EOL);
           sysctl_createv(clog, 0, NULL, NULL,
                           CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                           CTLTYPE_INT, "hashsize",
                           SYSCTL_DESCR("Size of hash table for fast forwarding (IPv4)"),
                           sysctl_net_inet_ip_hashsize, 0, &ip_hashsize, 0,
                           CTL_NET, PF_INET, IPPROTO_IP,
                           CTL_CREATE, CTL_EOL);
   #endif /* GATEWAY */
           sysctl_createv(clog, 0, NULL, NULL,
                          CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                          CTLTYPE_INT, "hostzerobroadcast",
                          SYSCTL_DESCR("All zeroes address is broadcast address"),
                          NULL, 0, &hostzeroisbroadcast, 0,
                          CTL_NET, PF_INET, IPPROTO_IP,
                          IPCTL_HOSTZEROBROADCAST, CTL_EOL);
 #if NGIF > 0  #if NGIF > 0
         sysctl_createv(clog, 0, NULL, NULL,          sysctl_createv(clog, 0, NULL, NULL,
                        CTLFLAG_PERMANENT|CTLFLAG_READWRITE,                         CTLFLAG_PERMANENT|CTLFLAG_READWRITE,

Legend:
Removed from v.1.307.2.3  
changed lines
  Added in v.1.308

CVSweb <webmaster@jp.NetBSD.org>