| version 1.93.2.5, 2001/02/11 19:17:14 |
version 1.93.2.6, 2001/03/12 13:31:50 |
| Line 414 ip_input(struct mbuf *m) |
|
| Line 414 ip_input(struct mbuf *m) |
|
| * not allowed. |
* not allowed. |
| */ |
*/ |
| if (IN_MULTICAST(ip->ip_src.s_addr)) { |
if (IN_MULTICAST(ip->ip_src.s_addr)) { |
| /* XXX stat */ |
ipstat.ips_badaddr++; |
| goto bad; |
goto bad; |
| } |
} |
| |
|
| |
/* 127/8 must not appear on wire - RFC1122 */ |
| |
if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || |
| |
(ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) { |
| |
if ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) { |
| |
ipstat.ips_badaddr++; |
| |
goto bad; |
| |
} |
| |
} |
| |
|
| if (in_cksum(m, hlen) != 0) { |
if (in_cksum(m, hlen) != 0) { |
| ipstat.ips_badsum++; |
ipstat.ips_badsum++; |
| goto bad; |
goto bad; |
|
|
| IPQ_UNLOCK(); |
IPQ_UNLOCK(); |
| } |
} |
| |
|
| |
#ifdef IPSEC |
| |
/* |
| |
* enforce IPsec policy checking if we are seeing last header. |
| |
* note that we do not visit this with protocols with pcb layer |
| |
* code - like udp/tcp/raw ip. |
| |
*/ |
| |
if ((inetsw[ip_protox[ip->ip_p]].pr_flags & PR_LASTHDR) != 0 && |
| |
ipsec4_in_reject(m, NULL)) { |
| |
ipsecstat.in_polvio++; |
| |
goto bad; |
| |
} |
| |
#endif |
| |
|
| /* |
/* |
| * Switch out to protocol's input routine. |
* Switch out to protocol's input routine. |
| */ |
*/ |