diff options
-rw-r--r-- | sys/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/netinet6/dest6.c | 12 | ||||
-rw-r--r-- | sys/netinet6/frag6.c | 7 | ||||
-rw-r--r-- | sys/netinet6/icmp6.c | 78 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 52 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 11 | ||||
-rw-r--r-- | sys/netinet6/mld6.c | 7 | ||||
-rw-r--r-- | sys/netinet6/nd6_nbr.c | 12 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 12 | ||||
-rw-r--r-- | sys/netinet6/route6.c | 17 |
10 files changed, 10 insertions, 201 deletions
diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC index f041a89ce9d..2d3af9f61b3 100644 --- a/sys/conf/GENERIC +++ b/sys/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.94 2003/05/13 06:06:39 tedu Exp $ +# $OpenBSD: GENERIC,v 1.95 2003/05/14 14:24:43 itojun Exp $ # # Machine-independent option; used by all architectures for their # GENERIC kernel @@ -61,7 +61,6 @@ option UNION # union file system option INET # IP + ICMP + TCP + UDP option ALTQ # ALTQ base option INET6 # IPv6 (needs INET) -option PULLDOWN_TEST # use m_pulldown for IPv6 packet parsing option IPSEC # IPsec #option KEY # PF_KEY (implied by IPSEC) #option NS # XNS diff --git a/sys/netinet6/dest6.c b/sys/netinet6/dest6.c index 370259da516..ecc4a1a6287 100644 --- a/sys/netinet6/dest6.c +++ b/sys/netinet6/dest6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dest6.c,v 1.9 2002/05/30 04:08:05 itojun Exp $ */ +/* $OpenBSD: dest6.c,v 1.10 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: dest6.c,v 1.25 2001/02/22 01:39:16 itojun Exp $ */ /* @@ -64,24 +64,14 @@ dest6_input(mp, offp, proto) u_int8_t *opt; /* validation of the length of the header */ -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, sizeof(*dstopts), IPPROTO_DONE); - dstopts = (struct ip6_dest *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(dstopts, struct ip6_dest *, m, off, sizeof(*dstopts)); if (dstopts == NULL) return IPPROTO_DONE; -#endif dstoptlen = (dstopts->ip6d_len + 1) << 3; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, dstoptlen, IPPROTO_DONE); - dstopts = (struct ip6_dest *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(dstopts, struct ip6_dest *, m, off, dstoptlen); if (dstopts == NULL) return IPPROTO_DONE; -#endif off += dstoptlen; dstoptlen -= sizeof(struct ip6_dest); opt = (u_int8_t *)dstopts + sizeof(struct ip6_dest); diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 838f023cad2..8febdc009c2 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.19 2002/09/11 03:27:30 itojun Exp $ */ +/* $OpenBSD: frag6.c,v 1.20 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -190,14 +190,9 @@ frag6_input(mp, offp, proto) u_int8_t ecn, ecn0; ip6 = mtod(m, struct ip6_hdr *); -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, offset, sizeof(struct ip6_frag), IPPROTO_DONE); - ip6f = (struct ip6_frag *)((caddr_t)ip6 + offset); -#else IP6_EXTHDR_GET(ip6f, struct ip6_frag *, m, offset, sizeof(*ip6f)); if (ip6f == NULL) return IPPROTO_DONE; -#endif dstifp = NULL; #ifdef IN6_IFSTAT_STRICT diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 3a0299c8732..e608082dfde 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.66 2003/04/01 01:09:37 itojun Exp $ */ +/* $OpenBSD: icmp6.c,v 1.67 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -288,15 +288,11 @@ icmp6_error(m, type, code, param) /* count per-type-code statistics */ icmp6_errcount(&icmp6stat.icp6s_outerrhist, type, code); -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, 0, sizeof(struct ip6_hdr), ); -#else if (m->m_len < sizeof(struct ip6_hdr)) { m = m_pullup(m, sizeof(struct ip6_hdr)); if (m == NULL) return; } -#endif oip6 = mtod(m, struct ip6_hdr *); /* @@ -334,17 +330,12 @@ icmp6_error(m, type, code, param) if (off >= 0 && nxt == IPPROTO_ICMPV6) { struct icmp6_hdr *icp; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, 0, off + sizeof(struct icmp6_hdr), ); - icp = (struct icmp6_hdr *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(icp, struct icmp6_hdr *, m, off, sizeof(*icp)); if (icp == NULL) { icmp6stat.icp6s_tooshort++; return; } -#endif if (icp->icmp6_type < ICMP6_ECHO_REQUEST || icp->icmp6_type == ND_REDIRECT) { /* @@ -438,11 +429,6 @@ icmp6_input(mp, offp, proto) icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_msg); -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, sizeof(struct icmp6_hdr), IPPROTO_DONE); - /* m might change if M_LOOP. So, call mtod after this */ -#endif - /* * Locate icmp6 structure in mbuf, and check * that not corrupted and of at least minimum length @@ -458,16 +444,12 @@ icmp6_input(mp, offp, proto) /* * calculate the checksum */ -#ifndef PULLDOWN_TEST - icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6)); if (icmp6 == NULL) { icmp6stat.icp6s_tooshort++; icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_error); return IPPROTO_DONE; } -#endif code = icmp6->icmp6_code; if ((sum = in6_cksum(m, IPPROTO_ICMPV6, off, icmp6len)) != 0) { @@ -713,10 +695,6 @@ icmp6_input(mp, offp, proto) goto badlen; if (mode == FQDN) { -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, sizeof(struct icmp6_nodeinfo), - IPPROTO_DONE); -#endif n = m_copym(m, 0, M_COPYALL, M_DONTWAIT); if (n) n = ni6_input(n, off); @@ -926,19 +904,12 @@ icmp6_notify_error(m, off, icmp6len, code) icmp6stat.icp6s_tooshort++; goto freeit; } -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, - sizeof(struct icmp6_hdr) + sizeof(struct ip6_hdr), - -1); - icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6) + sizeof(struct ip6_hdr)); if (icmp6 == NULL) { icmp6stat.icp6s_tooshort++; return (-1); } -#endif eip6 = (struct ip6_hdr *)(icmp6 + 1); /* Detect the upper level protocol */ @@ -962,20 +933,12 @@ icmp6_notify_error(m, off, icmp6len, code) case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_AH: -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, 0, eoff + - sizeof(struct ip6_ext), - -1); - eh = (struct ip6_ext *)(mtod(m, caddr_t) - + eoff); -#else IP6_EXTHDR_GET(eh, struct ip6_ext *, m, eoff, sizeof(*eh)); if (eh == NULL) { icmp6stat.icp6s_tooshort++; return (-1); } -#endif if (nxt == IPPROTO_AH) eoff += (eh->ip6e_len + 2) << 2; @@ -992,19 +955,12 @@ icmp6_notify_error(m, off, icmp6len, code) * information that depends on the final * destination (e.g. path MTU). */ -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, 0, eoff + sizeof(*rth), - -1); - rth = (struct ip6_rthdr *)(mtod(m, caddr_t) - + eoff); -#else IP6_EXTHDR_GET(rth, struct ip6_rthdr *, m, eoff, sizeof(*rth)); if (rth == NULL) { icmp6stat.icp6s_tooshort++; return (-1); } -#endif rthlen = (rth->ip6r_len + 1) << 3; /* * XXX: currently there is no @@ -1018,11 +974,6 @@ icmp6_notify_error(m, off, icmp6len, code) rth->ip6r_type == IPV6_RTHDR_TYPE_0) { int hops; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, 0, eoff + rthlen, - -1); - rth0 = (struct ip6_rthdr0 *)(mtod(m, caddr_t) + eoff); -#else IP6_EXTHDR_GET(rth0, struct ip6_rthdr0 *, m, eoff, rthlen); @@ -1030,7 +981,6 @@ icmp6_notify_error(m, off, icmp6len, code) icmp6stat.icp6s_tooshort++; return (-1); } -#endif /* just ignore a bogus header */ if ((rth0->ip6r0_len % 2) == 0 && (hops = rth0->ip6r0_len/2)) @@ -1040,20 +990,12 @@ icmp6_notify_error(m, off, icmp6len, code) nxt = rth->ip6r_nxt; break; case IPPROTO_FRAGMENT: -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, 0, eoff + - sizeof(struct ip6_frag), - -1); - fh = (struct ip6_frag *)(mtod(m, caddr_t) - + eoff); -#else IP6_EXTHDR_GET(fh, struct ip6_frag *, m, eoff, sizeof(*fh)); if (fh == NULL) { icmp6stat.icp6s_tooshort++; return (-1); } -#endif /* * Data after a fragment header is meaningless * unless it is the first fragment, but @@ -1079,16 +1021,12 @@ icmp6_notify_error(m, off, icmp6len, code) } } notify: -#ifndef PULLDOWN_TEST - icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6) + sizeof(struct ip6_hdr)); if (icmp6 == NULL) { icmp6stat.icp6s_tooshort++; return (-1); } -#endif eip6 = (struct ip6_hdr *)(icmp6 + 1); bzero(&icmp6dst, sizeof(icmp6dst)); @@ -1260,15 +1198,11 @@ ni6_input(m, off) char *subj = NULL; ip6 = mtod(m, struct ip6_hdr *); -#ifndef PULLDOWN_TEST - ni6 = (struct icmp6_nodeinfo *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(ni6, struct icmp6_nodeinfo *, m, off, sizeof(*ni6)); if (ni6 == NULL) { /* m is already reclaimed */ return NULL; } -#endif /* * Validate IPv6 destination address. @@ -1970,16 +1904,11 @@ icmp6_rip6_input(mp, off) struct icmp6_hdr *icmp6; struct mbuf *opts = NULL; -#ifndef PULLDOWN_TEST - /* this is assumed to be safe. */ - icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6)); if (icmp6 == NULL) { /* m is already reclaimed */ return IPPROTO_DONE; } -#endif bzero(&rip6src, sizeof(rip6src)); rip6src.sin6_len = sizeof(struct sockaddr_in6); @@ -2278,16 +2207,11 @@ icmp6_redirect_input(m, off) if (!icmp6_rediraccept) goto freeit; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, icmp6len,); - nd_rd = (struct nd_redirect *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(nd_rd, struct nd_redirect *, m, off, icmp6len); if (nd_rd == NULL) { icmp6stat.icp6s_tooshort++; return; } -#endif redtgt6 = nd_rd->nd_rd_target; reddst6 = nd_rd->nd_rd_dst; diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 75470e5fd2d..7432dec920b 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.48 2003/05/14 14:18:23 itojun Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.49 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -130,9 +130,7 @@ struct ip6stat ip6stat; static void ip6_init2(void *); static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); -#ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); -#endif /* * IP6 initialization: fill in IP6 protocol switch table. @@ -229,11 +227,6 @@ ip6_input(m) in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive); ip6stat.ip6s_total++; -#ifndef PULLDOWN_TEST - /* XXX is the line really necessary? */ - IP6_EXTHDR_CHECK(m, 0, sizeof(struct ip6_hdr), /*nothing*/); -#endif - if (m->m_len < sizeof(struct ip6_hdr)) { struct ifnet *inifp; inifp = m->m_pkthdr.rcvif; @@ -553,17 +546,12 @@ ip6_input(m) (caddr_t)&ip6->ip6_plen - (caddr_t)ip6); return; } -#ifndef PULLDOWN_TEST - /* ip6_hopopts_input() ensures that mbuf is contiguous */ - hbh = (struct ip6_hbh *)(ip6 + 1); -#else IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); if (hbh == NULL) { ip6stat.ip6s_tooshort++; return; } -#endif nxt = hbh->ip6h_nxt; /* @@ -685,14 +673,6 @@ ip6_hopopts_input(plenp, rtalertp, mp, offp) u_int8_t *opt; /* validation of the length of the header */ -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, sizeof(*hbh), -1); - hbh = (struct ip6_hbh *)(mtod(m, caddr_t) + off); - hbhlen = (hbh->ip6h_len + 1) << 3; - - IP6_EXTHDR_CHECK(m, off, hbhlen, -1); - hbh = (struct ip6_hbh *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); if (hbh == NULL) { @@ -706,7 +686,6 @@ ip6_hopopts_input(plenp, rtalertp, mp, offp) ip6stat.ip6s_tooshort++; return -1; } -#endif off += hbhlen; hbhlen -= sizeof(struct ip6_hbh); opt = (u_int8_t *)hbh + sizeof(struct ip6_hbh); @@ -995,14 +974,8 @@ ip6_savecontrol(in6p, mp, ip6, m) if (ip6->ip6_nxt == IPPROTO_HOPOPTS) { struct ip6_hbh *hbh; int hbhlen; -#ifdef PULLDOWN_TEST struct mbuf *ext; -#endif -#ifndef PULLDOWN_TEST - hbh = (struct ip6_hbh *)(ip6 + 1); - hbhlen = (hbh->ip6h_len + 1) << 3; -#else ext = ip6_pullexthdr(m, sizeof(struct ip6_hdr), ip6->ip6_nxt); if (ext == NULL) { @@ -1016,7 +989,6 @@ ip6_savecontrol(in6p, mp, ip6, m) ip6stat.ip6s_tooshort++; return; } -#endif /* * XXX: We copy whole the header even if a jumbo @@ -1028,9 +1000,7 @@ ip6_savecontrol(in6p, mp, ip6, m) IPV6_HOPOPTS, IPPROTO_IPV6); if (*mp) mp = &(*mp)->m_next; -#ifdef PULLDOWN_TEST m_freem(ext); -#endif } } @@ -1049,9 +1019,7 @@ ip6_savecontrol(in6p, mp, ip6, m) while (1) { /* is explicit loop prevention necessary? */ struct ip6_ext *ip6e = NULL; int elen; -#ifdef PULLDOWN_TEST struct mbuf *ext = NULL; -#endif /* * if it is not an extension header, don't try to @@ -1067,17 +1035,6 @@ ip6_savecontrol(in6p, mp, ip6, m) goto loopend; } -#ifndef PULLDOWN_TEST - if (off + sizeof(*ip6e) > m->m_len) - goto loopend; - ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + off); - if (nxt == IPPROTO_AH) - elen = (ip6e->ip6e_len + 2) << 2; - else - elen = (ip6e->ip6e_len + 1) << 3; - if (off + elen > m->m_len) - goto loopend; -#else ext = ip6_pullexthdr(m, off, nxt); if (ext == NULL) { ip6stat.ip6s_tooshort++; @@ -1093,7 +1050,6 @@ ip6_savecontrol(in6p, mp, ip6, m) ip6stat.ip6s_tooshort++; return; } -#endif switch (nxt) { case IPPROTO_DSTOPTS: @@ -1137,9 +1093,7 @@ ip6_savecontrol(in6p, mp, ip6, m) * the code just in case (nxt overwritten or * other cases). */ -#ifdef PULLDOWN_TEST m_freem(ext); -#endif goto loopend; } @@ -1148,10 +1102,8 @@ ip6_savecontrol(in6p, mp, ip6, m) off += elen; nxt = ip6e->ip6e_nxt; ip6e = NULL; -#ifdef PULLDOWN_TEST m_freem(ext); ext = NULL; -#endif } loopend: ; @@ -1159,7 +1111,6 @@ ip6_savecontrol(in6p, mp, ip6, m) # undef in6p_flags } -#ifdef PULLDOWN_TEST /* * pull single extension header from mbuf chain. returns single mbuf that * contains the result, or NULL on error. @@ -1213,7 +1164,6 @@ ip6_pullexthdr(m, off, nxt) n->m_len = elen; return n; } -#endif /* * Get pointer to the previous header followed by the header diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index b4cf2d88b0f..c3a67d12c1c 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.c,v 1.32 2003/05/07 02:12:09 deraadt Exp $ */ +/* $OpenBSD: ip6_mroute.c,v 1.33 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */ /* @@ -1681,20 +1681,11 @@ pim6_input(mp, offp, proto) * Make sure that the IP6 and PIM headers in contiguous memory, and * possibly the PIM REGISTER header */ -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, minlen, IPPROTO_DONE); - /* adjust pointer */ - ip6 = mtod(m, struct ip6_hdr *); - - /* adjust mbuf to point to the PIM header */ - pim = (struct pim *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(pim, struct pim *, m, off, minlen); if (pim == NULL) { pim6stat.pim6s_rcv_tooshort++; return IPPROTO_DONE; } -#endif #define PIM6_CHECKSUM #ifdef PIM6_CHECKSUM diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 8dab7ae1917..67e182917e1 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mld6.c,v 1.16 2002/06/09 14:38:39 itojun Exp $ */ +/* $OpenBSD: mld6.c,v 1.17 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: mld6.c,v 1.26 2001/02/16 14:50:35 itojun Exp $ */ /* @@ -188,16 +188,11 @@ mld6_input(m, off) struct in6_ifaddr *ia; int timer; /* timer value in the MLD query header */ -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, sizeof(*mldh),); - mldh = (struct mld6_hdr *)(mtod(m, caddr_t) + off); -#else IP6_EXTHDR_GET(mldh, struct mld6_hdr *, m, off, sizeof(*mldh)); if (mldh == NULL) { icmp6stat.icp6s_tooshort++; return; } -#endif /* source address validation */ ip6 = mtod(m, struct ip6_hdr *);/* in case mpullup */ diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 805cc6fc143..26a450e8678 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_nbr.c,v 1.27 2002/06/09 14:38:39 itojun Exp $ */ +/* $OpenBSD: nd6_nbr.c,v 1.28 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -100,16 +100,11 @@ nd6_ns_input(m, off, icmp6len) union nd_opts ndopts; struct sockaddr_dl *proxydl = NULL; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, icmp6len,); - nd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(nd_ns, struct nd_neighbor_solicit *, m, off, icmp6len); if (nd_ns == NULL) { icmp6stat.icp6s_tooshort++; return; } -#endif ip6 = mtod(m, struct ip6_hdr *); /* adjust pointer for safety */ taddr6 = nd_ns->nd_ns_target; @@ -560,16 +555,11 @@ nd6_na_input(m, off, icmp6len) goto bad; } -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, icmp6len,); - nd_na = (struct nd_neighbor_advert *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(nd_na, struct nd_neighbor_advert *, m, off, icmp6len); if (nd_na == NULL) { icmp6stat.icp6s_tooshort++; return; } -#endif taddr6 = nd_na->nd_na_target; flags = nd_na->nd_na_flags_reserved; is_router = ((flags & ND_NA_FLAG_ROUTER) != 0); diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index bd3e11eb7f7..721c2275e07 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.24 2003/05/13 02:25:08 itojun Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.25 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -131,16 +131,11 @@ nd6_rs_input(m, off, icmp6len) if (IN6_IS_ADDR_UNSPECIFIED(&saddr6)) goto freeit; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, icmp6len,); - nd_rs = (struct nd_router_solicit *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(nd_rs, struct nd_router_solicit *, m, off, icmp6len); if (nd_rs == NULL) { icmp6stat.icp6s_tooshort++; return; } -#endif icmp6len -= sizeof(*nd_rs); nd6_option_init(nd_rs + 1, icmp6len, &ndopts); @@ -226,16 +221,11 @@ nd6_ra_input(m, off, icmp6len) goto bad; } -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, icmp6len,); - nd_ra = (struct nd_router_advert *)((caddr_t)ip6 + off); -#else IP6_EXTHDR_GET(nd_ra, struct nd_router_advert *, m, off, icmp6len); if (nd_ra == NULL) { icmp6stat.icp6s_tooshort++; return; } -#endif icmp6len -= sizeof(*nd_ra); nd6_option_init(nd_ra + 1, icmp6len, &ndopts); diff --git a/sys/netinet6/route6.c b/sys/netinet6/route6.c index 045ed07eefb..ba04e656e64 100644 --- a/sys/netinet6/route6.c +++ b/sys/netinet6/route6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route6.c,v 1.8 2002/09/11 03:15:36 itojun Exp $ */ +/* $OpenBSD: route6.c,v 1.9 2003/05/14 14:24:44 itojun Exp $ */ /* $KAME: route6.c,v 1.22 2000/12/03 00:54:00 itojun Exp $ */ /* @@ -57,30 +57,16 @@ route6_input(mp, offp, proto) struct ip6_rthdr *rh; int off = *offp, rhlen; -#ifndef PULLDOWN_TEST - IP6_EXTHDR_CHECK(m, off, sizeof(*rh), IPPROTO_DONE); - ip6 = mtod(m, struct ip6_hdr *); - rh = (struct ip6_rthdr *)((caddr_t)ip6 + off); -#else ip6 = mtod(m, struct ip6_hdr *); IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, sizeof(*rh)); if (rh == NULL) { ip6stat.ip6s_tooshort++; return IPPROTO_DONE; } -#endif switch (rh->ip6r_type) { case IPV6_RTHDR_TYPE_0: rhlen = (rh->ip6r_len + 1) << 3; -#ifndef PULLDOWN_TEST - /* - * note on option length: - * due to IP6_EXTHDR_CHECK assumption, we cannot handle - * very big routing header (max rhlen == 2048). - */ - IP6_EXTHDR_CHECK(m, off, rhlen, IPPROTO_DONE); -#else /* * note on option length: * maximum rhlen: 2048 @@ -94,7 +80,6 @@ route6_input(mp, offp, proto) ip6stat.ip6s_tooshort++; return IPPROTO_DONE; } -#endif if (ip6_rthdr0(m, ip6, (struct ip6_rthdr0 *)rh)) return (IPPROTO_DONE); break; |