version 1.82.2.4, 2000/02/12 18:10:24 |
version 1.84, 1999/04/07 05:34:32 |
|
|
} |
} |
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 for additional length bogosity |
* Check for additional length bogosity |
*/ |
*/ |
if (len < hlen) |
if (len < hlen) { |
{ |
|
ipstat.ips_badlen++; |
ipstat.ips_badlen++; |
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) |
if (ia != NULL) { |
goto ours; |
if (ia->ia_ifp->if_flags & IFF_UP) |
|
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 1237 ip_forward(m, srcrt) |
|
Line 1228 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|M_MCAST) || in_canforward(ip->ip_dst) == 0) { |
if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) { |
ipstat.ips_cantforward++; |
ipstat.ips_cantforward++; |
m_freem(m); |
m_freem(m); |
return; |
return; |