Module Name:    src
Committed By:   yamaguchi
Date:           Thu Mar 23 07:26:07 UTC 2023

Modified Files:
        src/sys/dev/pci: if_vioif.c

Log Message:
vioif(4): clear flags when configure is failed


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/pci/if_vioif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.104 src/sys/dev/pci/if_vioif.c:1.105
--- src/sys/dev/pci/if_vioif.c:1.104	Thu Mar 23 03:55:11 2023
+++ src/sys/dev/pci/if_vioif.c	Thu Mar 23 07:26:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.104 2023/03/23 03:55:11 yamaguchi Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.105 2023/03/23 07:26:07 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.104 2023/03/23 03:55:11 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.105 2023/03/23 07:26:07 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -924,8 +924,10 @@ vioif_ifflags(struct vioif_softc *sc)
 		log(LOG_WARNING,
 		    "%s: couldn't %sable ALLMULTI\n",
 		    ifp->if_xname, onoff ? "en" : "dis");
-		if (onoff == false) {
-			ifp->if_flags |= IFF_ALLMULTI;
+		if (onoff) {
+			CLR(ifp->if_flags, IFF_ALLMULTI);
+		} else {
+			SET(ifp->if_flags, IFF_ALLMULTI);
 		}
 	}
 
@@ -935,8 +937,10 @@ vioif_ifflags(struct vioif_softc *sc)
 		log(LOG_WARNING,
 		    "%s: couldn't %sable PROMISC\n",
 		    ifp->if_xname, onoff ? "en" : "dis");
-		if (onoff == false) {
-			ifp->if_flags |= IFF_PROMISC;
+		if (onoff) {
+			CLR(ifp->if_flags, IFF_PROMISC);
+		} else {
+			SET(ifp->if_flags, IFF_PROMISC);
 		}
 	}
 

Reply via email to