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

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

Diff for /src/sys/netinet6/ip6_input.c between version 1.149.4.5 and 1.155

version 1.149.4.5, 2016/04/22 15:44:18 version 1.155, 2016/02/04 02:48:37
Line 144  pfil_head_t *inet6_pfil_hook;
Line 144  pfil_head_t *inet6_pfil_hook;
   
 percpu_t *ip6stat_percpu;  percpu_t *ip6stat_percpu;
   
 static void ip6_init2(void);  static void ip6_init2(void *);
 static void ip6intr(void *);  static void ip6intr(void *);
 static struct m_tag *ip6_setdstifaddr(struct mbuf *, const struct in6_ifaddr *);  static struct m_tag *ip6_setdstifaddr(struct mbuf *, const struct in6_ifaddr *);
   
Line 184  ip6_init(void)
Line 184  ip6_init(void)
         frag6_init();          frag6_init();
         ip6_desync_factor = cprng_fast32() % MAX_TEMP_DESYNC_FACTOR;          ip6_desync_factor = cprng_fast32() % MAX_TEMP_DESYNC_FACTOR;
   
         ip6_init2();          ip6_init2(NULL);
 #ifdef GATEWAY  #ifdef GATEWAY
         ip6flow_init(ip6_hashsize);          ip6flow_init(ip6_hashsize);
 #endif  #endif
Line 196  ip6_init(void)
Line 196  ip6_init(void)
 }  }
   
 static void  static void
 ip6_init2(void)  ip6_init2(void *dummy)
 {  {
   
           /* nd6_timer_init */
           callout_init(&nd6_timer_ch, CALLOUT_MPSAFE);
           callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL);
   
         /* timer for regeneranation of temporary addresses randomize ID */          /* timer for regeneranation of temporary addresses randomize ID */
         callout_init(&in6_tmpaddrtimer_ch, CALLOUT_MPSAFE);          callout_init(&in6_tmpaddrtimer_ch, CALLOUT_MPSAFE);
         callout_reset(&in6_tmpaddrtimer_ch,          callout_reset(&in6_tmpaddrtimer_ch,
Line 410  ip6_input(struct mbuf *m)
Line 414  ip6_input(struct mbuf *m)
          * to the usage conflict.           * to the usage conflict.
          * in6_setscope() then also checks and rejects the cases where src or           * in6_setscope() then also checks and rejects the cases where src or
          * dst are the loopback address and the receiving interface           * dst are the loopback address and the receiving interface
          * is not loopback.           * is not loopback.
          */           */
         if (__predict_false(          if (__predict_false(
             m_makewritable(&m, 0, sizeof(struct ip6_hdr), M_DONTWAIT)))              m_makewritable(&m, 0, sizeof(struct ip6_hdr), M_DONTWAIT)))
Line 476  ip6_input(struct mbuf *m)
Line 480  ip6_input(struct mbuf *m)
          */           */
         if (rt != NULL &&          if (rt != NULL &&
             (rt->rt_flags & (RTF_HOST|RTF_GATEWAY)) == RTF_HOST &&              (rt->rt_flags & (RTF_HOST|RTF_GATEWAY)) == RTF_HOST &&
               !(rt->rt_flags & RTF_CLONED) &&
 #if 0  #if 0
             /*              /*
              * The check below is redundant since the comparison of               * The check below is redundant since the comparison of
Line 499  ip6_input(struct mbuf *m)
Line 504  ip6_input(struct mbuf *m)
                         goto hbhcheck;                          goto hbhcheck;
                 } else {                  } else {
                         /* address is not ready, so discard the packet. */                          /* address is not ready, so discard the packet. */
                         nd6log(LOG_INFO, "packet to an unready address %s->%s\n",                          nd6log((LOG_INFO,
                               "ip6_input: packet to an unready address %s->%s\n",
                             ip6_sprintf(&ip6->ip6_src),                              ip6_sprintf(&ip6->ip6_src),
                             ip6_sprintf(&ip6->ip6_dst));                              ip6_sprintf(&ip6->ip6_dst)));
   
                         goto bad;                          goto bad;
                 }                  }
Line 801  ip6_getdstifaddr(struct mbuf *m)
Line 807  ip6_getdstifaddr(struct mbuf *m)
  * rtalertp - XXX: should be stored more smart way   * rtalertp - XXX: should be stored more smart way
  */   */
 int  int
 ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp,  ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp,
         struct mbuf **mp, int *offp)          struct mbuf **mp, int *offp)
 {  {
         struct mbuf *m = *mp;          struct mbuf *m = *mp;
Line 846  ip6_hopopts_input(u_int32_t *plenp, u_in
Line 852  ip6_hopopts_input(u_int32_t *plenp, u_in
  * opthead + hbhlen is located in continuous memory region.   * opthead + hbhlen is located in continuous memory region.
  */   */
 static int  static int
 ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen,  ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen,
         u_int32_t *rtalertp, u_int32_t *plenp)          u_int32_t *rtalertp, u_int32_t *plenp)
 {  {
         struct ip6_hdr *ip6;          struct ip6_hdr *ip6;
Line 1021  ip6_unknown_opt(u_int8_t *optp, struct m
Line 1027  ip6_unknown_opt(u_int8_t *optp, struct m
  * you are using IP6_EXTHDR_CHECK() not m_pulldown())   * you are using IP6_EXTHDR_CHECK() not m_pulldown())
  */   */
 void  void
 ip6_savecontrol(struct in6pcb *in6p, struct mbuf **mp,  ip6_savecontrol(struct in6pcb *in6p, struct mbuf **mp,
         struct ip6_hdr *ip6, struct mbuf *m)          struct ip6_hdr *ip6, struct mbuf *m)
 {  {
 #ifdef RFC2292  #ifdef RFC2292
Line 1526  ip6_delaux(struct mbuf *m)
Line 1532  ip6_delaux(struct mbuf *m)
 }  }
   
 #ifdef GATEWAY  #ifdef GATEWAY
 /*  /*
  * sysctl helper routine for net.inet.ip6.maxflows. Since   * sysctl helper routine for net.inet.ip6.maxflows. Since
  * we could reduce this value, call ip6flow_reap();   * we could reduce this value, call ip6flow_reap();
  */   */
 static int  static int
 sysctl_net_inet6_ip6_maxflows(SYSCTLFN_ARGS)  sysctl_net_inet6_ip6_maxflows(SYSCTLFN_ARGS)
 {  {
         int error;          int error;
   
         error = sysctl_lookup(SYSCTLFN_CALL(rnode));          error = sysctl_lookup(SYSCTLFN_CALL(rnode));
         if (error || newp == NULL)          if (error || newp == NULL)
                 return (error);                  return (error);
   
         mutex_enter(softnet_lock);          mutex_enter(softnet_lock);
         KERNEL_LOCK(1, NULL);          KERNEL_LOCK(1, NULL);
   
Line 1546  sysctl_net_inet6_ip6_maxflows(SYSCTLFN_A
Line 1552  sysctl_net_inet6_ip6_maxflows(SYSCTLFN_A
   
         KERNEL_UNLOCK_ONE(NULL);          KERNEL_UNLOCK_ONE(NULL);
         mutex_exit(softnet_lock);          mutex_exit(softnet_lock);
   
         return (0);          return (0);
 }  }
   
 static int  static int
 sysctl_net_inet6_ip6_hashsize(SYSCTLFN_ARGS)  sysctl_net_inet6_ip6_hashsize(SYSCTLFN_ARGS)
 {  {
         int error, tmp;          int error, tmp;
         struct sysctlnode node;          struct sysctlnode node;
   
Line 1579  sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A
Line 1585  sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A
                  * EINVAL if not a power of 2                   * EINVAL if not a power of 2
                  */                   */
                 error = EINVAL;                  error = EINVAL;
         }          }
   
         return error;          return error;
 }  }
Line 1903  sysctl_net_inet6_ip6_setup(struct sysctl
Line 1909  sysctl_net_inet6_ip6_setup(struct sysctl
                        NULL, 0, &ip6_mcast_pmtu, 0,                         NULL, 0, &ip6_mcast_pmtu, 0,
                        CTL_NET, PF_INET6, IPPROTO_IPV6,                         CTL_NET, PF_INET6, IPPROTO_IPV6,
                        CTL_CREATE, CTL_EOL);                         CTL_CREATE, CTL_EOL);
 #ifdef GATEWAY  #ifdef GATEWAY
         sysctl_createv(clog, 0, NULL, NULL,          sysctl_createv(clog, 0, NULL, NULL,
                         CTLFLAG_PERMANENT|CTLFLAG_READWRITE,                          CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                         CTLTYPE_INT, "maxflows",                          CTLTYPE_INT, "maxflows",

Legend:
Removed from v.1.149.4.5  
changed lines
  Added in v.1.155

CVSweb <webmaster@jp.NetBSD.org>