From 38f061057b076aff67a81e0aa873afb6a78d04fb Mon Sep 17 00:00:00 2001 From: Bruce M Simpson Date: Thu, 4 Nov 2004 02:14:38 +0000 Subject: [PATCH] When performing IP fast forwarding, immediately drop traffic which is destined for a blackhole route. This also means that blackhole routes do not need to be bound to lo(4) or disc(4) interfaces for the net.inet.ip.fastforwarding=1 case. Submitted by: james at towardex dot com Sponsored by: eXtensible Open Router Project MFC after: 3 weeks --- sys/netinet/ip_fastfwd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 09df699d88cc..1ad7d45b3f4f 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -432,6 +432,12 @@ ip_fastforward(struct mbuf *m) return 1; /* icmp unreach already sent */ ifp = ro.ro_rt->rt_ifp; + /* + * Immediately drop blackholed traffic. + */ + if (ro.ro_rt->rt_flags & RTF_BLACKHOLE) + goto drop; + /* * Step 5: outgoing firewall packet processing */