mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 01:00:30 -04:00
Protect EEPROM access with the driver lock.
This commit is contained in:
parent
fa799a4e7e
commit
693d469eee
1 changed files with 2 additions and 1 deletions
|
|
@ -766,6 +766,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||
|
||||
IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)");
|
||||
|
||||
EM_LOCK(sc);
|
||||
switch (sc->hw.mac_type) {
|
||||
case em_82573:
|
||||
/*
|
||||
|
|
@ -789,11 +790,11 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||
}
|
||||
if (ifr->ifr_mtu > max_frame_size - ETHER_HDR_LEN -
|
||||
ETHER_CRC_LEN) {
|
||||
EM_UNLOCK(sc);
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
EM_LOCK(sc);
|
||||
ifp->if_mtu = ifr->ifr_mtu;
|
||||
sc->hw.max_frame_size =
|
||||
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
|
||||
|
|
|
|||
Loading…
Reference in a new issue