From 9451b78569d906c3a2d85ac7cd27b9902419d0a9 Mon Sep 17 00:00:00 2001 From: fenner Date: Wed, 22 Jan 2003 23:30:26 +0000 Subject: 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 --- sys/net/if_vlan.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sys') diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 5671292..421a8b5 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -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. -- cgit v1.1