Pull up following revision(s) (requested by nonaka in ticket #1146):

sys/dev/hyperv/if_hvn.c: revision 1.19

hvn(4): fix unable to ifconfig up/down.
This commit is contained in:
martin 2020-12-11 15:43:16 +00:00
parent bab2621af0
commit 0362684733
1 changed files with 3 additions and 22 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_hvn.c,v 1.4.2.5 2019/11/26 08:22:51 martin Exp $ */
/* $NetBSD: if_hvn.c,v 1.4.2.6 2020/12/11 15:43:16 martin 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.4.2.5 2019/11/26 08:22:51 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.4.2.6 2020/12/11 15:43:16 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -376,26 +376,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);