Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_vlan.c
Show First 20 Lines • Show All 1,343 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid) | vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid) | ||||
{ | { | ||||
struct epoch_tracker et; | struct epoch_tracker et; | ||||
struct ifvlantrunk *trunk; | struct ifvlantrunk *trunk; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
int error = 0; | int error = 0, update_lladdr; | ||||
/* | /* | ||||
* We can handle non-ethernet hardware types as long as | * We can handle non-ethernet hardware types as long as | ||||
* they handle the tagging and headers themselves. | * they handle the tagging and headers themselves. | ||||
*/ | */ | ||||
if (p->if_type != IFT_ETHER && | if (p->if_type != IFT_ETHER && | ||||
(p->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) | (p->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) | ||||
return (EPROTONOSUPPORT); | return (EPROTONOSUPPORT); | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | #undef VLAN_COPY_FLAGS | ||||
NET_EPOCH_ENTER(et); | NET_EPOCH_ENTER(et); | ||||
vlan_capabilities(ifv); | vlan_capabilities(ifv); | ||||
NET_EPOCH_EXIT(et); | NET_EPOCH_EXIT(et); | ||||
/* | /* | ||||
* Set up our interface address to reflect the underlying | * Set up our interface address to reflect the underlying | ||||
* physical interface's. | * physical interface's. | ||||
*/ | */ | ||||
update_lladdr = memcmp(IF_LLADDR(p), IF_LLADDR(ifp), p->if_addrlen); | |||||
bcopy(IF_LLADDR(p), IF_LLADDR(ifp), p->if_addrlen); | bcopy(IF_LLADDR(p), IF_LLADDR(ifp), p->if_addrlen); | ||||
((struct sockaddr_dl *)ifp->if_addr->ifa_addr)->sdl_alen = | ((struct sockaddr_dl *)ifp->if_addr->ifa_addr)->sdl_alen = | ||||
p->if_addrlen; | p->if_addrlen; | ||||
TASK_INIT(&ifv->lladdr_task, 0, vlan_lladdr_fn, ifv); | TASK_INIT(&ifv->lladdr_task, 0, vlan_lladdr_fn, ifv); | ||||
if (update_lladdr != 0) | |||||
taskqueue_enqueue(taskqueue_thread, &ifv->lladdr_task); | |||||
/* We are ready for operation now. */ | /* We are ready for operation now. */ | ||||
ifp->if_drv_flags |= IFF_DRV_RUNNING; | ifp->if_drv_flags |= IFF_DRV_RUNNING; | ||||
/* Update flags on the parent, if necessary. */ | /* Update flags on the parent, if necessary. */ | ||||
vlan_setflags(ifp, 1); | vlan_setflags(ifp, 1); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 597 Lines • Show Last 20 Lines |