hvn(4): fix unable to ifconfig up/down.

This commit is contained in:
nonaka 2020-12-11 08:13:08 +00:00
parent f38b032d02
commit f9a11fc69d

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_hvn.c,v 1.18 2020/05/24 10:31:59 nonaka Exp $ */
/* $NetBSD: if_hvn.c,v 1.19 2020/12/11 08:13:08 nonaka Exp $ */
/* $OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $ */
/*-
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.18 2020/05/24 10:31:59 nonaka Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.19 2020/12/11 08:13:08 nonaka Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -387,26 +387,7 @@ hvn_ioctl(struct ifnet *ifp, u_long command, void * data)
s = splnet();
switch (command) {
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if (ifp->if_flags & IFF_RUNNING)
error = ENETRESET;
else {
error = hvn_init(ifp);
if (error)
ifp->if_flags &= ~IFF_UP;
}
} else {
if (ifp->if_flags & IFF_RUNNING)
hvn_stop(ifp, 1);
}
break;
default:
error = ether_ioctl(ifp, command, data);
break;
}
error = ether_ioctl(ifp, command, data);
if (error == ENETRESET) {
if (ifp->if_flags & IFF_RUNNING)
hvn_iff(sc);