backout 1.78, ioctl(SIOCSIFADDR) is needed to test if the interface

supports AF_INET or not
This commit is contained in:
itojun 2002-09-04 03:45:01 +00:00
parent 8b01de5e08
commit 98ba20f9e4
1 changed files with 3 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: in.c,v 1.78 2002/09/04 00:03:58 itojun Exp $ */
/* $NetBSD: in.c,v 1.79 2002/09/04 03:45:01 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.78 2002/09/04 00:03:58 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.79 2002/09/04 03:45:01 itojun Exp $");
#include "opt_inet.h"
#include "opt_inet_conf.h"
@ -792,8 +792,6 @@ in_ifinit(ifp, ia, sin, scrub)
u_int32_t i = sin->sin_addr.s_addr;
struct sockaddr_in oldaddr;
int s = splnet(), flags = RTF_UP, error;
int ifacount;
struct ifaddr *ifa;
/*
* Set up new addresses.
@ -809,15 +807,7 @@ in_ifinit(ifp, ia, sin, scrub)
* if this is its first address,
* and to validate the address if necessary.
*/
ifacount = 0;
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr == NULL)
continue;
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ifacount++;
}
if (ifacount <= 1 && ifp->if_ioctl &&
if (ifp->if_ioctl &&
(error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia)))
goto bad;
splx(s);