#endif
nd6_init();
frag6_init();
+ icmp6_init();
/*
* in many cases, random() here does NOT return random number
* as initialization during bootstrap time occur in fixed order.
ip6_flow_seq = random() ^ tv.tv_usec;
microtime(&tv);
ip6_desync_factor = (random() ^ tv.tv_usec) % MAX_TEMP_DESYNC_FACTOR;
- timeout(ip6_init2, (caddr_t)0, 1 * hz);
+ timeout(ip6_init2, (caddr_t)0, 2 * hz);
}
static void
* to route local address of p2p link to loopback,
* assign loopback address first.
*/
- in6_ifattach(&loif[0], NULL);
+ in6_ifattach(&loif[0], NULL, NULL);
#ifdef __APPLE__
/* nd6_timer_init */
ip6_delaux(m);
/*
- * mbuf statistics by kazu
+ * mbuf statistics
*/
if (m->m_flags & M_EXT) {
if (m->m_next)
#define M2MMAX (sizeof(ip6stat.ip6s_m2m)/sizeof(ip6stat.ip6s_m2m[0]))
if (m->m_next) {
if (m->m_flags & M_LOOP) {
- ip6stat.ip6s_m2m[loif[0].if_index]++; /*XXX*/
+ ip6stat.ip6s_m2m[loif[0].if_index]++; /* XXX */
} else if (m->m_pkthdr.rcvif->if_index < M2MMAX)
ip6stat.ip6s_m2m[m->m_pkthdr.rcvif->if_index]++;
else
n = NULL;
}
}
- if (!n) {
+ if (n == NULL) {
m_freem(m);
return; /*ENOBUFS*/
}
in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
goto bad;
}
+
/*
* The following check is not documented in specs. A malicious
* party may be able to use IPv4 mapped addr to confuse tcp/udp stack
&& ip6_forward_rt.ro_rt->rt_ifp->if_type == IFT_FAITH) {
/* XXX do we need more sanity checks? */
ours = 1;
- deliverifp = ip6_forward_rt.ro_rt->rt_ifp; /*faith*/
+ deliverifp = ip6_forward_rt.ro_rt->rt_ifp; /* faith */
goto hbhcheck;
}
}
ip6 = mtod(m, struct ip6_hdr *);
/*
- * if the payload length field is 0 and the next header field
+ * if the payload length field is 0 and the next header field
* indicates Hop-by-Hop Options header, then a Jumbo Payload
* option MUST be included.
*/
}
} else {
n = m_aux_add(m, AF_INET6, -1);
- n->m_len = sizeof(struct ip6aux);
- bzero(mtod(n, caddr_t), n->m_len);
+ if (n) {
+ n->m_len = sizeof(struct ip6aux);
+ bzero(mtod(n, caddr_t), n->m_len);
+ }
}
return n;
}