diff --git a/emhttp/plugins/dynamix/Eth0.page b/emhttp/plugins/dynamix/Eth0.page index 960bdff54..035ca53de 100644 --- a/emhttp/plugins/dynamix/Eth0.page +++ b/emhttp/plugins/dynamix/Eth0.page @@ -23,7 +23,10 @@ $validIP4 = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]? $validIP6 = "(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(:|([0-9a-fA-F]{1,4}:)+):(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?)"; $enable = _('Enable default gateway'); $metric = _('metric value, a lower value is more preferred'); - +$jumbo = _('Enable jumbo frames'); +$jumbo_1 = _('Allows the use of ethernet frames larger than 1500 bytes'); +$jumbo_2 = _('Connectivity issues may occur when other devices do not support this feature'); +$jumbo_3 = _('Or if they are improperly configured, use this feature with care'); $masks = [ '255.0.0.0' => '8', '255.255.0.0' => '16', '255.255.128.0' => '17', '255.255.192.0' => '18', '255.255.224.0' => '19', '255.255.240.0' => '20', '255.255.248.0' => '21', '255.255.252.0' => '22', @@ -209,7 +212,7 @@ function prepareSettings(form) { var i = $(this).prop('name').split(':')[1]; var protocol = $(form).find('select[name="PROTOCOL:'+i+'"]').val() || 'ipv4'; var metric = $(form).find('input[name="METRIC:'+i+'"]').val(); - var gw4 = (port == 'eth0') ? true : $(form).find('input[name="USE_GW:'+i+'"]').prop('checked'); + var gw4 = (port == 'eth0') ? true : $(form).find('input[name="USE_GW4:'+i+'"]').prop('checked'); if (protocol != 'ipv6' && $(this).val() != 'no') { $(form).find('input[name="IPADDR:'+i+'"]').prop('disabled',false).val(''); $(form).find('input[name="GATEWAY:'+i+'"]').prop('disabled',false).val(''); @@ -235,6 +238,8 @@ function prepareSettings(form) { $(form).find('input[name="'+name+'"]').val(data); }); } + // force default MTU if jumbo frames are not enabled + if ($(form).find('input[name="USE_MTU"]').prop('checked') == false) $(form).find('input[name="MTU"]').val(''); $(form).find('input[name="#arg[1]"]').val(arg1[port]); setTimeout(refresh, 25000); return true; @@ -356,6 +361,11 @@ function selectGW(form, prot, index, step) { } } +function selectMTU(form) { + let jumbo = $(form).find('input[name="USE_MTU"]').prop('checked'); + $(form).find('input[name="MTU"]').prop('disabled',!jumbo); +} + function checkNetworkSettings(form, index) { var disabled4 = $(form).find('select[name="USE_DHCP:'+index+'"]').val()!='no'; var disabled6 = $(form).find('select[name="USE_DHCP6:'+index+'"]').val()!='no'; @@ -521,6 +531,7 @@ $(function() { checkNetworkAccess(form); selectProtocol(form); selectGW(form); + selectMTU(form); disableForm(form); $('#bond-eth0').dropdownchecklist('disable'); @@ -757,7 +768,8 @@ _(IPv6 privacy extensions)_: _(Desired MTU)_: -: +: > + >  :eth_desired_mtu_help: @@ -797,7 +809,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -826,7 +838,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: 0):?> @@ -892,7 +904,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -915,7 +927,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: diff --git a/emhttp/plugins/dynamix/EthX.page b/emhttp/plugins/dynamix/EthX.page index 8775be0bf..0d6fb874f 100644 --- a/emhttp/plugins/dynamix/EthX.page +++ b/emhttp/plugins/dynamix/EthX.page @@ -58,6 +58,7 @@ $(function() { checkNetworkAccess(form); selectProtocol(form); selectGW(form); + selectMTU(form); $('div.slave-ethX').hide(); disableForm(form); @@ -165,7 +166,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -194,7 +195,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: @@ -230,7 +231,8 @@ _(IPv6 privacy extensions)_:
_(Desired MTU)_: -: +: > + >  :eth_desired_mtu_help: @@ -271,7 +273,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -300,7 +302,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: @@ -365,7 +367,7 @@ _(Network protocol)_:
_(IPv4 address assignment)_: -: @@ -388,7 +390,7 @@ _(IPv4 default gateway)_:
_(IPv6 address assignment)_: -: diff --git a/emhttp/plugins/dynamix/include/update.wireless.php b/emhttp/plugins/dynamix/include/update.wireless.php index 0aa3f00bb..1f4153b26 100644 --- a/emhttp/plugins/dynamix/include/update.wireless.php +++ b/emhttp/plugins/dynamix/include/update.wireless.php @@ -14,8 +14,8 @@ $open_ssl = "/usr/local/emhttp/webGui/scripts/open_ssl"; // encrypt username and password before saving (if existing) -if (!empty($_POST['USERNAME'])) $_POST['USERNAME'] = exec("$open_ssl encrypt \"{$_POST['USERNAME']}\""); -if (!empty($_POST['PASSWORD'])) $_POST['PASSWORD'] = exec("$open_ssl encrypt \"{$_POST['PASSWORD']}\""); +if (!empty($_POST['USERNAME'])) $_POST['USERNAME'] = exec("$open_ssl encrypt ".escapeshellarg($_POST['USERNAME'])); +if (!empty($_POST['PASSWORD'])) $_POST['PASSWORD'] = exec("$open_ssl encrypt ".escapeshellarg($_POST['PASSWORD'])); // update active wifi selection foreach ($keys as $key => $val) if (isset($val['GROUP'])) $keys[$key]['GROUP'] = 'saved'; diff --git a/emhttp/plugins/dynamix/nchan/wlan0 b/emhttp/plugins/dynamix/nchan/wlan0 index 5ec3e1b08..57a9ed993 100755 --- a/emhttp/plugins/dynamix/nchan/wlan0 +++ b/emhttp/plugins/dynamix/nchan/wlan0 @@ -53,15 +53,17 @@ while (true) { $locale_init = _var($display,'locale'); update_translation($locale_init); } - if (is_readable($ini) && is_readable($wlan0)) { - $wifi = parse_ini_file($ini); - $up = file_get_contents($wlan0)==1; - $alive = $up ? exec("iw wlan0 link 2>/dev/null | grep -Pom1 'SSID: \K.+'") : ''; - $echo['color'] = $alive==$wifi['SSID'] ? 'blue-text' : 'red-text'; - $echo['title'] = $alive==$wifi['SSID'] ? _('WiFi connected') : _('WiFi disconnected'); - } else { - $echo['color'] = 'grey-text'; - $echo['title'] = _('No active WiFi'); + if (is_readable($ini) && file_exists($wlan0)) { + try { + $wifi = parse_ini_file($ini); + $up = @file_get_contents($wlan0) == 1; + $alive = $up ? exec("iw wlan0 link 2>/dev/null | grep -Pom1 'SSID: \\K.+'") : ''; + $echo['color'] = $alive == $wifi['SSID'] ? 'blue-text' : 'red-text'; + $echo['title'] = $alive == $wifi['SSID'] ? _('WiFi connected') : _('WiFi disconnected'); + } catch (Exception $e) { + $echo['color'] = 'grey-text'; + $echo['title'] = _('WiFi status unavailable'); + } } publish('wlan0',json_encode($echo)); sleep(3); diff --git a/emhttp/plugins/dynamix/sheets/Eth0.css b/emhttp/plugins/dynamix/sheets/Eth0.css index 190d92c0d..c95569ff9 100644 --- a/emhttp/plugins/dynamix/sheets/Eth0.css +++ b/emhttp/plugins/dynamix/sheets/Eth0.css @@ -11,4 +11,5 @@ div.shade-gray{background-color:#121510;margin-top:10px;padding:8px 0 3px 0} select.slim{min-width:47px;margin-left:4px} input.slim{width:32px;margin-left:8px} input[type=text].narrow{display:inline;font-size:1.3rem;background-color:transparent;text-indent:0;height:auto;min-height:2rem;line-height:2rem;outline:none;margin:0 20px 0 0;box-shadow:none;border-radius:0;-webkit-transition:none;transition:none} -.hide{display:none} \ No newline at end of file +.hide{display:none} +select.ctrl{margin-right:20px} \ No newline at end of file diff --git a/sbin/create_network_ini b/sbin/create_network_ini index 7bb80a20b..afe6c39e1 100755 --- a/sbin/create_network_ini +++ b/sbin/create_network_ini @@ -159,6 +159,7 @@ for ((i=0; i<${SYSNICS:-1}; i++)); do echo "METRIC6:0=\"${METRIC6[$i]}\"" >>$INI echo "PRIVACY6:0=\"\"" >>$INI fi + echo "USE_MTU=\"${USE_MTU[$i]}\"" >>$INI echo "MTU=\"${MTU[$i]}\"" >>$INI if [[ -n ${VLANS[$i]} ]]; then # process VLAN interfaces