Revision e3ad8ccd
Added by NewEraCracker over 9 years ago
src/etc/inc/interfaces.inc | ||
---|---|---|
3120 | 3120 |
continue; |
3121 | 3121 |
} |
3122 | 3122 |
|
3123 |
$mtus = array(); |
|
3124 |
if (!empty($ppp['mtu'])) { |
|
3125 |
$mtus = explode(',', $ppp['mtu']); |
|
3126 |
} |
|
3123 | 3127 |
$ports = explode(',', $ppp['ports']); |
3128 |
|
|
3124 | 3129 |
$mtu_wanted = 1500; |
3125 | 3130 |
foreach ($ports as $pid => $port) { |
3126 | 3131 |
if (get_real_interface($port) != $realif) { |
3127 | 3132 |
continue; |
3128 | 3133 |
} |
3129 | 3134 |
|
3130 |
if (!empty($ppp['mtu'])) { |
|
3131 |
$mtus = explode(',', $ppp['mtu']); |
|
3132 |
} else { |
|
3133 |
$mtus = array(); |
|
3134 |
} |
|
3135 | 3135 |
// there is an MTU configured on the port in question |
3136 | 3136 |
if (!empty($mtus[$pid])) { |
3137 | 3137 |
$mtu_wanted = intval($mtus[$pid]) + 8; |
... | ... | |
3145 | 3145 |
} |
3146 | 3146 |
} |
3147 | 3147 |
} |
3148 |
unset($mtus); |
|
3149 | 3148 |
|
3150 | 3149 |
if ($mtu_wanted > $mtu) { |
3151 | 3150 |
$mtu = $mtu_wanted; |
Also available in: Unified diff
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