don't panic when there's no interface address exist for the specified multicast

outgoing interface (ia == NULL after IFP_TO_IA).

historic behavior (up to revision 1.43) was to use 0.0.0.0 as source address,
but it seems like a mistake according to RFC1112/1122.
This commit is contained in:
itojun 2002-01-08 10:05:13 +00:00
parent f401e7e08b
commit 1cc58965b6
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_output.c,v 1.90 2001/11/21 06:28:08 itojun Exp $ */
/* $NetBSD: ip_output.c,v 1.91 2002/01/08 10:05:13 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.90 2001/11/21 06:28:08 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.91 2002/01/08 10:05:13 itojun Exp $");
#include "opt_pfil_hooks.h"
#include "opt_ipsec.h"
@ -317,6 +317,10 @@ ip_output(m0, va_alist)
struct in_ifaddr *ia;
IFP_TO_IA(ifp, ia);
if (!ia) {
error = EADDRNOTAVAIL;
goto bad;
}
ip->ip_src = ia->ia_addr.sin_addr;
}