vlan: Fix the incorrect logic
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 25 Feb 2012 11:08:33 +0000 (19:08 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 25 Feb 2012 11:08:33 +0000 (19:08 +0800)
It should speak that parent interface is gone or parent interface
was changed.

sys/net/vlan/if_vlan.c

index 4bfcd09..ae12ccc 100644 (file)
@@ -884,7 +884,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr)
 
                        ifnet_serialize_all(ifp);
 
-                       if (ifv->ifv_p == NULL && ifv->ifv_p != ifp_p) {
+                       if (ifv->ifv_p == NULL || ifv->ifv_p != ifp_p) {
                                /*
                                 * We are disconnected from the original
                                 * parent interface or the parent interface