Commit f5e93272 authored by Franco Fichtner's avatar Franco Fichtner

inc: two more replacements; almost done

parent 86033e1e
...@@ -726,32 +726,16 @@ function interface_bridge_add_member($bridgeif, $interface) ...@@ -726,32 +726,16 @@ function interface_bridge_add_member($bridgeif, $interface)
} }
$options = pfSense_get_interface_addresses($bridgeif); $options = pfSense_get_interface_addresses($bridgeif);
$flags_on = 0; $flags = sprintf(
$flags_off = 0; '%stxcsum %srxcsum %stso4 %stso6 %slro',
if (isset($options['encaps']['txcsum'])) isset($options['encaps']['txcsum']) ? '' : '-',
$flags_on |= IFCAP_TXCSUM; isset($options['encaps']['rxcsum']) ? '' : '-',
else isset($options['encaps']['tso4']) ? '' : '-',
$flags_off |= IFCAP_TXCSUM; isset($options['encaps']['tso6']) ? '' : '-',
if (isset($options['encaps']['rxcsum'])) isset($options['encaps']['lro']) ? '' : '-'
$flags_on |= IFCAP_RXCSUM; );
else
$flags_off |= IFCAP_RXCSUM;
if (isset($options['encaps']['tso4']))
$flags_on |= IFCAP_TSO4;
else
$flags_off |= IFCAP_TSO4;
if (isset($options['encaps']['tso6']))
$flags_on |= IFCAP_TSO6;
else
$flags_off |= IFCAP_TSO6;
if (isset($options['encaps']['lro']))
$flags_on |= IFCAP_LRO;
else
$flags_off |= IFCAP_LRO;
pfSense_interface_capabilities($interface, -$flags_off);
pfSense_interface_capabilities($interface, $flags_on);
legacy_interface_flags($interface, $flags);
interfaces_bring_up($interface); interfaces_bring_up($interface);
legacy_bridge_member($bridgeif, $interface); legacy_bridge_member($bridgeif, $interface);
} }
...@@ -821,28 +805,27 @@ function interface_lagg_configure(&$lagg) ...@@ -821,28 +805,27 @@ function interface_lagg_configure(&$lagg)
if ($smallermtu == 0) if ($smallermtu == 0)
$smallermtu = 1500; $smallermtu = 1500;
$flags_on = 0; $flags = '';
$flags_off = 0; if (isset($config['system']['disablechecksumoffloading']) || ($commonrx === false)) {
if (isset($config['system']['disablechecksumoffloading']) || ($commonrx === false)) $flags .= '';
$flags_off |= IFCAP_RXCSUM; }
else $flags .= 'rxcsum ';
$flags_on |= IFCAP_RXCSUM; if (isset($config['system']['disablechecksumoffloading']) || ($commontx === false)) {
if (isset($config['system']['disablechecksumoffloading']) || ($commontx === false)) $flags .= '';
$flags_off |= IFCAP_TXCSUM; }
else $flags .= 'txcsum ';
$flags_on |= IFCAP_TXCSUM; if (isset($config['system']['disablesegmentationoffloading']) || ($commontso4 === false)) {
if (isset($config['system']['disablesegmentationoffloading']) || ($commontso4 === false)) $flags .= '';
$flags_off |= IFCAP_TSO4; }
else $flags .= 'tso4 ';
$flags_on |= IFCAP_TSO4; if (isset($config['system']['disablesegmentationoffloading']) || ($commontso6 === false)) {
if (isset($config['system']['disablesegmentationoffloading']) || ($commontso6 === false)) $flags .= '';
$flags_off |= IFCAP_TSO6; }
else $flags .= 'tso6 ';
$flags_on |= IFCAP_TSO6; if (isset($config['system']['disablelargereceiveoffloading']) || ($commonlro === false)) {
if (isset($config['system']['disablelargereceiveoffloading']) || ($commonlro === false)) $flags .= '';
$flags_off |= IFCAP_LRO; }
else $flags .= 'lro ';
$flags_on |= IFCAP_LRO;
$checklist = get_interface_list(); $checklist = get_interface_list();
...@@ -853,8 +836,7 @@ function interface_lagg_configure(&$lagg) ...@@ -853,8 +836,7 @@ function interface_lagg_configure(&$lagg)
/* make sure the parent interface is up */ /* make sure the parent interface is up */
legacy_interface_mtu($member, $smallermtu); legacy_interface_mtu($member, $smallermtu);
pfSense_interface_capabilities($member, -$flags_off); legacy_interface_flags($member, $flags);
pfSense_interface_capabilities($member, $flags_on);
interfaces_bring_up($member); interfaces_bring_up($member);
mwexec("/sbin/ifconfig {$laggif} laggport {$member}"); mwexec("/sbin/ifconfig {$laggif} laggport {$member}");
} }
......
...@@ -52,7 +52,8 @@ function legacy_interface_listget($flag = '') ...@@ -52,7 +52,8 @@ function legacy_interface_listget($flag = '')
function legacy_interface_flags($ifs, $flag) function legacy_interface_flags($ifs, $flag)
{ {
$cmd = '/sbin/ifconfig ' . escapeshellarg($ifs) . ' ' . escapeshellarg($flag); /* $flags isn't escaped because it can be an argument list */
$cmd = '/sbin/ifconfig ' . escapeshellarg($ifs) . ' ' . $flag;
exec($cmd . ' 2>&1', $out, $ret); exec($cmd . ' 2>&1', $out, $ret);
if ($ret) { if ($ret) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment