summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2004-07-21 19:55:14 +0000
committerandre <andre@FreeBSD.org>2004-07-21 19:55:14 +0000
commit695543e4da52de37acbefbb1254b7aae54bd0709 (patch)
tree16192d1db35e0904d9375d363cb7095980967e44 /sys/netinet
parent697fd69b851e325aff839d56bd1bda29af5b50f5 (diff)
downloadFreeBSD-src-695543e4da52de37acbefbb1254b7aae54bd0709.zip
FreeBSD-src-695543e4da52de37acbefbb1254b7aae54bd0709.tar.gz
Extend versrcreach by checking against the rt_flags for RTF_REJECT and
RTF_BLACKHOLE as well. To quote the submitter: The uRPF loose-check implementation by the industry vendors, at least on Cisco and possibly Juniper, will fail the check if the route of the source address is pointed to Null0 (on Juniper, discard or reject route). What this means is, even if uRPF Loose-check finds the route, if the route is pointed to blackhole, uRPF loose-check must fail. This allows people to utilize uRPF loose-check mode as a pseudo-packet-firewall without using any manual filtering configuration -- one can simply inject a IGP or BGP prefix with next-hop set to a static route that directs to null/discard facility. This results in uRPF Loose-check failing on all packets with source addresses that are within the range of the nullroute. Submitted by: James Jun <james@towardex.com>
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_fw2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index 0b6f754..de6abf3 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -506,6 +506,12 @@ verify_path(struct in_addr src, struct ifnet *ifp)
return 0;
}
+ /* or if this is a blackhole/reject route */
+ if (ifp == NULL && ro.ro_rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
+ RTFREE(ro.ro_rt);
+ return 0;
+ }
+
/* found valid route */
RTFREE(ro.ro_rt);
return 1;
OpenPOWER on IntegriCloud