Let vlan_ioctl() pass some work on to ether_ioctl()
and so reduce code duplication a bit.
This commit is contained in:
parent
d6eb3444a3
commit
9c6dee24d7
@ -1326,30 +1326,6 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
ifv = ifp->if_softc;
|
||||
|
||||
switch (cmd) {
|
||||
case SIOCSIFADDR:
|
||||
ifp->if_flags |= IFF_UP;
|
||||
|
||||
switch (ifa->ifa_addr->sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
arp_ifinit(ifv->ifv_ifp, ifa);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGIFADDR:
|
||||
{
|
||||
struct sockaddr *sa;
|
||||
|
||||
sa = (struct sockaddr *) &ifr->ifr_data;
|
||||
bcopy(IF_LLADDR(ifp), (caddr_t)sa->sa_data,
|
||||
ETHER_ADDR_LEN);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGIFMEDIA:
|
||||
VLAN_LOCK();
|
||||
if (TRUNK(ifv) != NULL) {
|
||||
@ -1457,7 +1433,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
break;
|
||||
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, cmd, data);
|
||||
}
|
||||
|
||||
return (error);
|
||||
|
Loading…
Reference in New Issue
Block a user