| version 1.150.2.1, 2002/06/20 15:52:21 |
version 1.150.2.2, 2002/07/15 10:36:58 |
| Line 420 ip_input(struct mbuf *m) |
|
| Line 420 ip_input(struct mbuf *m) |
|
| if (TAILQ_FIRST(&in_ifaddr) == 0) |
if (TAILQ_FIRST(&in_ifaddr) == 0) |
| goto bad; |
goto bad; |
| ipstat.ips_total++; |
ipstat.ips_total++; |
| if (m->m_len < sizeof (struct ip) && |
/* |
| (m = m_pullup(m, sizeof (struct ip))) == 0) { |
* If the IP header is not aligned, slurp it up into a new |
| ipstat.ips_toosmall++; |
* mbuf with space for link headers, in the event we forward |
| return; |
* it. Otherwise, if it is aligned, make sure the entire |
| |
* base IP header is in the first mbuf of the chain. |
| |
*/ |
| |
if (IP_HDR_ALIGNED_P(mtod(m, caddr_t)) == 0) { |
| |
if ((m = m_copyup(m, sizeof(struct ip), |
| |
(max_linkhdr + 3) & ~3)) == NULL) { |
| |
/* XXXJRT new stat, please */ |
| |
ipstat.ips_toosmall++; |
| |
return; |
| |
} |
| |
} else if (__predict_false(m->m_len < sizeof (struct ip))) { |
| |
if ((m = m_pullup(m, sizeof (struct ip))) == NULL) { |
| |
ipstat.ips_toosmall++; |
| |
return; |
| |
} |
| } |
} |
| ip = mtod(m, struct ip *); |
ip = mtod(m, struct ip *); |
| if (ip->ip_v != IPVERSION) { |
if (ip->ip_v != IPVERSION) { |