summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpokala <rpokala@FreeBSD.org>2018-02-22 19:39:44 +0000
committerrpokala <rpokala@FreeBSD.org>2018-02-22 19:39:44 +0000
commitffafd2a4bc029c790f9e037b4845924588b4ae83 (patch)
tree25948cdfc6676c1899d604070807f1f2f2cba20a
parent7e5d9b6a7678c9febc24ad9e34f3f972de794af1 (diff)
downloadFreeBSD-src-ffafd2a4bc029c790f9e037b4845924588b4ae83.zip
FreeBSD-src-ffafd2a4bc029c790f9e037b4845924588b4ae83.tar.gz
MFC r329295:
Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when the NIC is not a member of a lagg. This came as a surprise, because the SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the laggX interface, rather than a physical port) or EINVAL (if run against a non-member physical port). This behavior was not seen with other drivers, such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl handlers, I found that they all called ether_ioctl() for the default (i.e. unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two specific cases, and returns ENOTTY for the default case. Remove the two cases which explicitly call ether_ioctl(), and let the default case call it instead. This matches what the vast majority of the NIC drivers do.
-rw-r--r--sys/dev/mxge/if_mxge.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c
index c14fda9..f7d09e6 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -4161,11 +4161,6 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
err = 0;
switch (command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- err = ether_ioctl(ifp, command, data);
- break;
-
case SIOCSIFMTU:
err = mxge_change_mtu(sc, ifr->ifr_mtu);
break;
@@ -4289,7 +4284,8 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
break;
default:
- err = ENOTTY;
+ err = ether_ioctl(ifp, command, data);
+ break;
}
return err;
}
OpenPOWER on IntegriCloud