1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-30 16:51:41 +00:00

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>
This commit is contained in:
Julian Elischer 1999-02-08 05:48:46 +00:00
parent d031cff181
commit b0935ca284
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43763

View File

@ -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;