diff options
author | NewEraCracker <neweracracker@gmail.com> | 2016-02-11 19:54:34 +0000 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2016-02-14 12:38:36 -0600 |
commit | e3ad8ccd7f95cf572e05a3ecc2a4276a9a8b058a (patch) | |
tree | 50298d61f6d2922eafbc1cae08db91fe797aa1f3 | |
parent | 5524c2efe15a1870fd97a7717e7d4c78b74c906c (diff) | |
download | pfsense-e3ad8ccd7f95cf572e05a3ecc2a4276a9a8b058a.zip pfsense-e3ad8ccd7f95cf572e05a3ecc2a4276a9a8b058a.tar.gz |
Logic correction
From my understanding ppp['mtu'] and ppp['ports'] are directly related with each other and they correlate information about mtu and ports. This specific commit doesn't introduce anything new other than simplifying the code slightly
-rw-r--r-- | src/etc/inc/interfaces.inc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 5d4d775..fb9a766 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -3120,18 +3120,18 @@ function interface_mtu_wanted_for_pppoe($realif) { continue; } + $mtus = array(); + if (!empty($ppp['mtu'])) { + $mtus = explode(',', $ppp['mtu']); + } $ports = explode(',', $ppp['ports']); + $mtu_wanted = 1500; foreach ($ports as $pid => $port) { if (get_real_interface($port) != $realif) { continue; } - if (!empty($ppp['mtu'])) { - $mtus = explode(',', $ppp['mtu']); - } else { - $mtus = array(); - } // there is an MTU configured on the port in question if (!empty($mtus[$pid])) { $mtu_wanted = intval($mtus[$pid]) + 8; @@ -3145,7 +3145,6 @@ function interface_mtu_wanted_for_pppoe($realif) { } } } - unset($mtus); if ($mtu_wanted > $mtu) { $mtu = $mtu_wanted; |