mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
neta: Fix MTU change sequence
The IFF_DRV_RUNNING flag is used to see if the interface needs to be temporarily brought down during MTU change sequence. The problem here is that this flag is cleared in mvneta_stop_locked, resulting in the reinitialization logic never being executed after MTU has been changed. Fix that by saving the flag value before the interface is brought down. Reported by: Jérôme Tomczyk <jerome.tomczyk@stormshield.eu> Approved by: mw(mentor) Obtained from: Semihalf Sponsored by: Stormshield MFC after: 2 weeks
This commit is contained in:
parent
6d645da0d4
commit
97ecdc00ac
1 changed files with 6 additions and 2 deletions
|
|
@ -2054,9 +2054,11 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
struct ifreq *ifr;
|
||||
int error, mask;
|
||||
uint32_t flags;
|
||||
bool reinit;
|
||||
int q;
|
||||
|
||||
error = 0;
|
||||
reinit = false;
|
||||
sc = ifp->if_softc;
|
||||
ifr = (struct ifreq *)data;
|
||||
switch (cmd) {
|
||||
|
|
@ -2157,8 +2159,10 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
* Reinitialize RX queues.
|
||||
* We need to update RX descriptor size.
|
||||
*/
|
||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
|
||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
|
||||
reinit = true;
|
||||
mvneta_stop_locked(sc);
|
||||
}
|
||||
|
||||
for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) {
|
||||
mvneta_rx_lockq(sc, q);
|
||||
|
|
@ -2172,7 +2176,7 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
}
|
||||
mvneta_rx_unlockq(sc, q);
|
||||
}
|
||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
|
||||
if (reinit)
|
||||
mvneta_init_locked(sc);
|
||||
|
||||
mvneta_sc_unlock(sc);
|
||||
|
|
|
|||
Loading…
Reference in a new issue