diff options
author | jim-p <jimp@netgate.com> | 2019-06-03 14:21:05 -0400 |
---|---|---|
committer | jim-p <jimp@netgate.com> | 2019-06-03 14:21:31 -0400 |
commit | affe8a552ef1f7b8e59f3b60fd1421aa46f45b03 (patch) | |
tree | 467d2dae29c07ef2987baaa46b73c7274b78e77b | |
parent | ef0045d8127566c57be4d4f3a3986cdcbe9cd095 (diff) | |
download | pfsense-affe8a552ef1f7b8e59f3b60fd1421aa46f45b03.zip pfsense-affe8a552ef1f7b8e59f3b60fd1421aa46f45b03.tar.gz |
Set IPsec VTI MTU to configured value at boot. Implements #9111
(cherry picked from commit 3334f9c4cd7111c624ba2395b91c065d7dd338b1)
-rw-r--r-- | src/etc/inc/interfaces.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index dde2027..6e0aaca 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -1453,6 +1453,21 @@ function interface_ipsec_vti_configure($ph1ent) { file_put_contents("/tmp/{$ipsecif}_router{$gwtype}", $addr['right']); } } + /* Check/set the MTU if the user configured a custom value. + * https://redmine.pfsense.org/issues/9111 */ + $currentvtimtu = get_interface_mtu($ipsecif); + foreach ($config['interfaces'] as $tmpinterface) { + if ($tmpinterface['if'] == $ipsecif) { + if (isset($tmpinterface['mtu']) && is_numericint($tmpinterface['mtu'])) { + $vtimtu = $tmpinterface['mtu']; + } + } + } + if (is_numericint($vtimtu)) { + if ($vtimtu != $currentvtimtu) { + mwexec("/sbin/ifconfig {$ipsecif} mtu {$vtimtu}"); + } + } system_routing_configure(convert_real_interface_to_friendly_interface_name($ipsecif)); } } |