version 1.60, 2003/01/20 05:30:11 |
version 1.61, 2003/05/14 06:47:41 |
|
|
in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive); |
in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_receive); |
ip6stat.ip6s_total++; |
ip6stat.ip6s_total++; |
|
|
#ifndef PULLDOWN_TEST |
|
/* XXX is the line really necessary? */ |
|
IP6_EXTHDR_CHECK(m, 0, sizeof(struct ip6_hdr), /*nothing*/); |
|
#endif |
|
|
|
/* |
/* |
* If the IPv6 header is not aligned, slurp it up into a new |
* If the IPv6 header is not aligned, slurp it up into a new |
* mbuf with space for link headers, in the event we forward |
* mbuf with space for link headers, in the event we forward |
|
|
(caddr_t)&ip6->ip6_plen - (caddr_t)ip6); |
(caddr_t)&ip6->ip6_plen - (caddr_t)ip6); |
return; |
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), |
IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), |
sizeof(struct ip6_hbh)); |
sizeof(struct ip6_hbh)); |
if (hbh == NULL) { |
if (hbh == NULL) { |
ip6stat.ip6s_tooshort++; |
ip6stat.ip6s_tooshort++; |
return; |
return; |
} |
} |
#endif |
|
KASSERT(IP6_HDR_ALIGNED_P(hbh)); |
KASSERT(IP6_HDR_ALIGNED_P(hbh)); |
nxt = hbh->ip6h_nxt; |
nxt = hbh->ip6h_nxt; |
|
|
Line 782 ip6_hopopts_input(plenp, rtalertp, mp, o |
|
Line 772 ip6_hopopts_input(plenp, rtalertp, mp, o |
|
u_int8_t *opt; |
u_int8_t *opt; |
|
|
/* validation of the length of the header */ |
/* 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, |
IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, |
sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); |
sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); |
if (hbh == NULL) { |
if (hbh == NULL) { |
Line 803 ip6_hopopts_input(plenp, rtalertp, mp, o |
|
Line 785 ip6_hopopts_input(plenp, rtalertp, mp, o |
|
ip6stat.ip6s_tooshort++; |
ip6stat.ip6s_tooshort++; |
return -1; |
return -1; |
} |
} |
#endif |
|
KASSERT(IP6_HDR_ALIGNED_P(hbh)); |
KASSERT(IP6_HDR_ALIGNED_P(hbh)); |
off += hbhlen; |
off += hbhlen; |
hbhlen -= sizeof(struct ip6_hbh); |
hbhlen -= sizeof(struct ip6_hbh); |
Line 1095 ip6_savecontrol(in6p, mp, ip6, m) |
|
Line 1076 ip6_savecontrol(in6p, mp, ip6, m) |
|
struct ip6_hbh *hbh; |
struct ip6_hbh *hbh; |
int hbhlen; |
int hbhlen; |
|
|
#ifndef PULLDOWN_TEST |
|
hbh = (struct ip6_hbh *)(ip6 + 1); |
|
hbhlen = (hbh->ip6h_len + 1) << 3; |
|
#else |
|
IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, |
IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, |
sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); |
sizeof(struct ip6_hdr), sizeof(struct ip6_hbh)); |
if (hbh == NULL) { |
if (hbh == NULL) { |
Line 1112 ip6_savecontrol(in6p, mp, ip6, m) |
|
Line 1089 ip6_savecontrol(in6p, mp, ip6, m) |
|
ip6stat.ip6s_tooshort++; |
ip6stat.ip6s_tooshort++; |
return; |
return; |
} |
} |
#endif |
|
|
|
/* |
/* |
* XXX: We copy whole the header even if a jumbo |
* XXX: We copy whole the header even if a jumbo |
Line 1143 ip6_savecontrol(in6p, mp, ip6, m) |
|
Line 1119 ip6_savecontrol(in6p, mp, ip6, m) |
|
struct ip6_ext *ip6e; |
struct ip6_ext *ip6e; |
int elen; |
int elen; |
|
|
#ifndef PULLDOWN_TEST |
|
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; |
|
#else |
|
IP6_EXTHDR_GET(ip6e, struct ip6_ext *, m, off, |
IP6_EXTHDR_GET(ip6e, struct ip6_ext *, m, off, |
sizeof(struct ip6_ext)); |
sizeof(struct ip6_ext)); |
if (ip6e == NULL) { |
if (ip6e == NULL) { |
Line 1165 ip6_savecontrol(in6p, mp, ip6, m) |
|
Line 1134 ip6_savecontrol(in6p, mp, ip6, m) |
|
ip6stat.ip6s_tooshort++; |
ip6stat.ip6s_tooshort++; |
return; |
return; |
} |
} |
#endif |
|
KASSERT(IP6_HDR_ALIGNED_P(ip6e)); |
KASSERT(IP6_HDR_ALIGNED_P(ip6e)); |
|
|
switch (nxt) { |
switch (nxt) { |