Implement SIOCGIFMEDIA for vlan devices by passing the request to the

parent device, if there is a parent configured.  Modify the result
 returned by the parent to indicate that the only supported media
 is the currently configured one.

Reviewed by:	brooks
This commit is contained in:
Bill Fenner 2003-01-22 23:30:26 +00:00
parent 19ad245042
commit b3cca10864

View File

@ -679,6 +679,29 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
break;
case SIOCGIFMEDIA:
if (ifv->ifv_p != NULL) {
error = (ifv->ifv_p->if_ioctl)(ifv->ifv_p, SIOCGIFMEDIA, data);
/* Limit the result to the parent's current config. */
if (error == 0) {
struct ifmediareq *ifmr;
ifmr = (struct ifmediareq *) data;
if (ifmr->ifm_count >= 1 && ifmr->ifm_ulist) {
ifmr->ifm_count = 1;
error = copyout(&ifmr->ifm_current,
ifmr->ifm_ulist,
sizeof(int));
}
}
} else
error = EINVAL;
break;
case SIOCSIFMEDIA:
error = EINVAL;
break;
case SIOCSIFMTU:
/*
* Set the interface MTU.