From faed5d8543a405613993ef47e082c131ff6bc319 Mon Sep 17 00:00:00 2001 From: bms Date: Mon, 12 Feb 2007 12:52:54 +0000 Subject: [PATCH] MFC rev 1.39: When fast-forwarding is enabled, do not forward directed IPv4 broadcasts to locally attached broadcast networks. Note well: This relies on the layer 2 route cloning behaviour in BSD. PR: 98799 Tested by: Dmitry Sergienko --- sys/netinet/ip_fastfwd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index db44c710882..95861fddd8e 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -417,9 +417,11 @@ ip_fastforward(struct mbuf *m) ifp = ro.ro_rt->rt_ifp; /* - * Immediately drop blackholed traffic. + * Immediately drop blackholed traffic, and directed broadcasts + * for either the all-ones or all-zero subnet addresses on + * locally attached networks. */ - if (ro.ro_rt->rt_flags & RTF_BLACKHOLE) + if ((ro.ro_rt->rt_flags & (RTF_BLACKHOLE|RTF_BROADCAST)) != 0) goto drop; /* -- 2.45.2