aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1999-02-08 05:48:46 +0000
committerJulian Elischer <julian@FreeBSD.org>1999-02-08 05:48:46 +0000
commitb0935ca2849ab59b61af1c3a9e65280c9e880cdf (patch)
tree56a44700b4c7e592ddcb38a575d2def341479f20 /sys
parentd031cff1811d3403ce32d5bac0f0948b417b4dfb (diff)
downloadsrc-b0935ca2849ab59b61af1c3a9e65280c9e880cdf.tar.gz
src-b0935ca2849ab59b61af1c3a9e65280c9e880cdf.zip
Fix for PR 9309.
Divert was not feeding clean data to ifa_ifwithaddr() so it was giving bad results. Submitted by: kseel <kseel@utcorp.com>, Ruslan Ermilov <ru@ucb.crimea.ua>
Notes
Notes: svn path=/head/; revision=43763
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_divert.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index b39948e9c66c..9a709e5b51dc 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ip_divert.c,v 1.34 1998/07/06 09:06:58 julian Exp $
+ * $Id: ip_divert.c,v 1.35 1998/12/04 22:54:53 archie Exp $
*/
#include "opt_inet.h"
@@ -313,6 +313,15 @@ div_output(so, m, addr, control)
/* If no luck with the name above. check by IP address. */
if (m->m_pkthdr.rcvif == NULL) {
+ /*
+ * Make sure there are no distractions
+ * for ifa_ifwithaddr. Clear the port and the ifname.
+ * Maybe zap all 8 bytes at once using a 64bit write?
+ */
+ bzero(sin->sin_zero, sizeof(sin->sin_zero));
+ /* *((u_int64_t *)sin->sin_zero) = 0; */ /* XXX ?? */
+ sin->sin_port = 0;
+ *zp = 0;
if (!(ifa = ifa_ifwithaddr((struct sockaddr *) sin))) {
error = EADDRNOTAVAIL;
goto cantsend;