summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2007-02-03 06:45:51 +0000
committerbms <bms@FreeBSD.org>2007-02-03 06:45:51 +0000
commitb6b883252e5d6c0fcb51fb3e958a992c2c21bb3f (patch)
tree927c9279b68ebe0d081dc5a0db43152be8201485 /sys/netinet/ip_input.c
parent6443ab2e87fb5541609750151b564c5a8ac78df4 (diff)
downloadFreeBSD-src-b6b883252e5d6c0fcb51fb3e958a992c2c21bb3f.zip
FreeBSD-src-b6b883252e5d6c0fcb51fb3e958a992c2c21bb3f.tar.gz
In regular forwarding path, reject packets destined for 169.254.0.0/16
link-local addresses. See RFC 3927 section 2.7.
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 5e682b6..82e9939 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -528,6 +528,12 @@ passin:
#endif
}
}
+ /* RFC 3927 2.7: Do not forward datagrams for 169.254.0.0/16. */
+ if (IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr))) {
+ ipstat.ips_cantforward++;
+ m_freem(m);
+ return;
+ }
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
struct in_multi *inm;
if (ip_mrouter) {
OpenPOWER on IntegriCloud