Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_vlan.c
Show First 20 Lines • Show All 1,851 Lines • ▼ Show 20 Lines | #ifdef VIMAGE | ||||
* associated with. We are not entirely convinced that this | * associated with. We are not entirely convinced that this | ||||
* is the right way to accomplish that policy goal. | * is the right way to accomplish that policy goal. | ||||
*/ | */ | ||||
if (ifp->if_vnet != ifp->if_home_vnet) { | if (ifp->if_vnet != ifp->if_home_vnet) { | ||||
error = EPERM; | error = EPERM; | ||||
break; | break; | ||||
} | } | ||||
#endif | #endif | ||||
error = copyin(ifr->ifr_data, &vlr, sizeof(vlr)); | error = copyin(ifr_data_get_ptr(ifr), &vlr, sizeof(vlr)); | ||||
if (error) | if (error) | ||||
break; | break; | ||||
if (vlr.vlr_parent[0] == '\0') { | if (vlr.vlr_parent[0] == '\0') { | ||||
vlan_unconfig(ifp); | vlan_unconfig(ifp); | ||||
break; | break; | ||||
} | } | ||||
p = ifunit_ref(vlr.vlr_parent); | p = ifunit_ref(vlr.vlr_parent); | ||||
if (p == NULL) { | if (p == NULL) { | ||||
Show All 14 Lines | #endif | ||||
bzero(&vlr, sizeof(vlr)); | bzero(&vlr, sizeof(vlr)); | ||||
VLAN_SLOCK(); | VLAN_SLOCK(); | ||||
if (TRUNK(ifv) != NULL) { | if (TRUNK(ifv) != NULL) { | ||||
strlcpy(vlr.vlr_parent, PARENT(ifv)->if_xname, | strlcpy(vlr.vlr_parent, PARENT(ifv)->if_xname, | ||||
sizeof(vlr.vlr_parent)); | sizeof(vlr.vlr_parent)); | ||||
vlr.vlr_tag = ifv->ifv_vid; | vlr.vlr_tag = ifv->ifv_vid; | ||||
} | } | ||||
VLAN_SUNLOCK(); | VLAN_SUNLOCK(); | ||||
error = copyout(&vlr, ifr->ifr_data, sizeof(vlr)); | error = copyout(&vlr, ifr_data_get_ptr(ifr), sizeof(vlr)); | ||||
break; | break; | ||||
case SIOCSIFFLAGS: | case SIOCSIFFLAGS: | ||||
/* | /* | ||||
* We should propagate selected flags to the parent, | * We should propagate selected flags to the parent, | ||||
* e.g., promiscuous mode. | * e.g., promiscuous mode. | ||||
*/ | */ | ||||
VLAN_XLOCK(); | VLAN_XLOCK(); | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |