diff options
-rw-r--r-- | sys/netinet/in.c | 2 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 4af8f06..1d2fd93 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -141,7 +141,7 @@ in_canforward(in) register u_long i = ntohl(in.s_addr); register u_long net; - if (IN_EXPERIMENTAL(i) || IN_MULTICAST(i)) + if (IN_EXPERIMENTAL(i) || IN_MULTICAST(i) || IN_LINKLOCAL(i)) return (0); if (IN_CLASSA(i)) { net = i & IN_CLASSA_NET; 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) { |