Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140889449
D29968.id88151.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29968.id88151.diff
View Options
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -736,23 +736,19 @@
}
ia = NULL;
}
- /* RFC 3927 2.7: Do not forward datagrams for 169.254.0.0/16. */
- if (IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr))) {
- IPSTAT_INC(ips_cantforward);
- m_freem(m);
- return;
- }
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
if (V_ip_mrouter) {
/*
* If we are acting as a multicast router, all
- * incoming multicast packets are passed to the
- * kernel-level multicast forwarding function.
+ * incoming multicast packets without link-local
+ * source addresses are passed to the kernel-level
+ * multicast forwarding function.
* The packet is returned (relatively) intact; if
* ip_mforward() returns a non-zero value, the packet
* must be discarded, else it may be accepted below.
*/
- if (ip_mforward && ip_mforward(ip, ifp, m, 0) != 0) {
+ if (!IN_LINKLOCAL(ntohl(ip->ip_src.s_addr)) &&
+ ip_mforward && ip_mforward(ip, ifp, m, 0) != 0) {
IPSTAT_INC(ips_cantforward);
m_freem(m);
return;
@@ -779,6 +775,14 @@
if (ip->ip_dst.s_addr == INADDR_ANY)
goto ours;
+ /* RFC 3927 2.7: Do not forward datagrams for 169.254.0.0/16. */
+ if (IN_LINKLOCAL(ntohl(ip->ip_src.s_addr)) ||
+ IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr))) {
+ IPSTAT_INC(ips_cantforward);
+ m_freem(m);
+ return;
+ }
+
/*
* Not for us; forward if possible and desirable.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 30, 6:53 AM (20 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27378073
Default Alt Text
D29968.id88151.diff (1 KB)
Attached To
Mode
D29968: Do not forward datagrams original from 169.254.0.0/16 link-local addresses
Attached
Detach File
Event Timeline
Log In to Comment