RFC1122 requires that addresses of the form { 127, <any> } MUST NOT
appear outside a host. PR: 30792, 33996 Obtained from: ip_input.c MFC after: 1 week
This commit is contained in:
parent
f460490260
commit
8c3f5566ae
@ -422,9 +422,19 @@ ip_output(m0, opt, ro, flags, imo)
|
||||
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 ((ifp->if_flags & IFF_LOOPBACK) == 0) {
|
||||
ipstat.ips_badaddr++;
|
||||
error = EADDRNOTAVAIL;
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for broadcast address and
|
||||
* and verify user is allowed to send
|
||||
* verify user is allowed to send
|
||||
* such a packet.
|
||||
*/
|
||||
if (isbroadcast) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user