hyperv/hn: Don't allow MTU change, if it is not supported by the NVS.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7923
This commit is contained in:
sephe 2016-09-19 07:32:08 +00:00
parent f5b041ff24
commit d5de427dd3

View File

@ -1572,6 +1572,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
HN_LOCK(sc);
if ((sc->hn_caps & HN_CAP_MTU) == 0) {
/* Can't change MTU */
HN_UNLOCK(sc);
error = EOPNOTSUPP;
break;
}
if (ifp->if_mtu == ifr->ifr_mtu) {
HN_UNLOCK(sc);
break;