summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2003-01-22 23:30:26 +0000
committerfenner <fenner@FreeBSD.org>2003-01-22 23:30:26 +0000
commit9451b78569d906c3a2d85ac7cd27b9902419d0a9 (patch)
treee76e71f4724d7febfcc2686ab05a4de20224e4d8 /sys
parentd88366b7f0cb0451c7289ae52214785436347463 (diff)
downloadFreeBSD-src-9451b78569d906c3a2d85ac7cd27b9902419d0a9.zip
FreeBSD-src-9451b78569d906c3a2d85ac7cd27b9902419d0a9.tar.gz
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
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_vlan.c23
1 files changed, 23 insertions, 0 deletions
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.
OpenPOWER on IntegriCloud