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
MFC after:	1 week
This commit is contained in:
bms 2007-02-05 00:15:40 +00:00
parent 06da132002
commit 7925e63ddf

View File

@ -420,9 +420,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;
/*