kern/98799: [netinet] fastforwarding routes packets to network
ip address
Colin Petrie
cpetrie at xcalibre.co.uk
Tue Jun 27 11:00:49 UTC 2006
The following reply was made to PR kern/98799; it has been noted by GNATS.
From: Colin Petrie <cpetrie at xcalibre.co.uk>
To: bug-followup at FreeBSD.org, dmitry at trifle.net
Cc:
Subject: Re: kern/98799: [netinet] fastforwarding routes packets to network
ip address
Date: Tue, 27 Jun 2006 11:58:57 +0100
This is a multi-part message in MIME format.
--------------020208010008040701020709
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
This patch should fix your issue, could you give it a try and let me
know if it works?
I make no promises about this code being any good but it appears to do
the job at my end where I have the same problem
Please let me know if this helps
Regards,
Colin
--------------020208010008040701020709
Content-Type: text/x-patch;
name="fastfwd.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="fastfwd.patch"
*** ip_fastfwd.c Tue Jun 27 11:29:01 2006
--- ip_fastfwd.c.new Tue Jun 27 11:30:18 2006
*************** ip_fastforward(struct mbuf *m)
*** 162,167 ****
--- 162,168 ----
u_short sum, ip_len;
int error = 0;
int hlen, mtu;
+ int isbroadcast;
#ifdef IPFIREWALL_FORWARD
struct m_tag *fwd_tag;
#endif
*************** ip_fastforward(struct mbuf *m)
*** 275,280 ****
--- 276,282 ----
goto drop;
}
+
#ifdef ALTQ
/*
* Is packet dropped by traffic conditioner?
*************** passin:
*** 421,426 ****
--- 423,439 ----
*/
if (ro.ro_rt->rt_flags & RTF_BLACKHOLE)
goto drop;
+
+ /*
+ * Is packet a directed network broadcast packet?
+ */
+ isbroadcast = in_broadcast(dst->sin_addr, ifp);
+ if (isbroadcast) {
+ printf("ip_fastfwd: dropping directed broadcast - to %s\n",
+ inet_ntoa(dst->sin_addr));
+ ipstat.ips_badaddr++;
+ goto drop;
+ }
/*
* Step 5: outgoing firewall packet processing
--------------020208010008040701020709--
More information about the freebsd-bugs
mailing list