diff options
author | julian <julian@FreeBSD.org> | 1999-02-08 05:48:46 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-02-08 05:48:46 +0000 |
commit | 82933dc0a184eef353d804f76b6c73fe9a0023bb (patch) | |
tree | 7d33371df0a21099010d6ad8d2de1d4ce121c282 /sys/netinet/ip_divert.c | |
parent | 8bdc42c0a1340eeb1451b527d47cdb2320e495b1 (diff) | |
download | FreeBSD-src-82933dc0a184eef353d804f76b6c73fe9a0023bb.zip FreeBSD-src-82933dc0a184eef353d804f76b6c73fe9a0023bb.tar.gz |
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>
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r-- | sys/netinet/ip_divert.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index b39948e..9a709e5 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; |