| version 1.82, 1999/03/27 01:24:49 |
version 1.82.2.4, 2000/02/12 18:10:24 |
|
|
| } |
} |
| ip = mtod(m, struct ip *); |
ip = mtod(m, struct ip *); |
| } |
} |
| |
|
| |
/* |
| |
* RFC1122: packets with a multicast source address are |
| |
* not allowed. |
| |
*/ |
| |
if (IN_MULTICAST(ip->ip_src.s_addr)) { |
| |
/* XXX stat */ |
| |
goto bad; |
| |
} |
| |
|
| if (in_cksum(m, hlen) != 0) { |
if (in_cksum(m, hlen) != 0) { |
| ipstat.ips_badsum++; |
ipstat.ips_badsum++; |
| goto bad; |
goto bad; |
|
|
| * Check our list of addresses, to see if the packet is for us. |
* Check our list of addresses, to see if the packet is for us. |
| */ |
*/ |
| INADDR_TO_IA(ip->ip_dst, ia); |
INADDR_TO_IA(ip->ip_dst, ia); |
| if (ia != NULL) goto ours; |
if (ia != NULL) |
| |
goto ours; |
| if (m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST) { |
if (m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST) { |
| for (ifa = m->m_pkthdr.rcvif->if_addrlist.tqh_first; |
for (ifa = m->m_pkthdr.rcvif->if_addrlist.tqh_first; |
| ifa != NULL; ifa = ifa->ifa_list.tqe_next) { |
ifa != NULL; ifa = ifa->ifa_list.tqe_next) { |
| Line 1226 ip_forward(m, srcrt) |
|
| Line 1237 ip_forward(m, srcrt) |
|
| ntohl(ip->ip_src.s_addr), |
ntohl(ip->ip_src.s_addr), |
| ntohl(ip->ip_dst.s_addr), ip->ip_ttl); |
ntohl(ip->ip_dst.s_addr), ip->ip_ttl); |
| #endif |
#endif |
| if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) { |
if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) { |
| ipstat.ips_cantforward++; |
ipstat.ips_cantforward++; |
| m_freem(m); |
m_freem(m); |
| return; |
return; |