diff options
author | Ermal <eri@pfsense.org> | 2010-08-17 17:38:38 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-08-17 17:38:38 +0000 |
commit | 07676e3699b0d92667c0df11493e604592d3a809 (patch) | |
tree | 29b46ec075143d45a9494c6815c3964e51c0b2f1 | |
parent | 15c5b5d63710f28284a974902d0771ceefbb5e86 (diff) | |
download | pfsense-07676e3699b0d92667c0df11493e604592d3a809.zip pfsense-07676e3699b0d92667c0df11493e604592d3a809.tar.gz |
Ticket #88. When creating the bridge find the common flags needed related to rxcsum/txcsum so that the bridge actually works.
-rw-r--r-- | etc/inc/interfaces.inc | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 021d76d..6477095 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -327,9 +327,16 @@ function interface_bridge_configure(&$bridge) { /* Calculate smaller mtu and enforce it */ $smallermtu = 0; + $commonrx = true; + $commontx = true; foreach ($members as $member) { $realif = get_real_interface($member); - $mtu = get_interface_mtu($realif); + $opts = pfSense_get_interface_addresses($realif); + $mtu = $opts['mtu']; + if (!isset($opts['encaps']['txcsum'])) + $commontx = false; + if (!isset($opts['encaps']['rxcsum'])) + $commonrx = false; if ($smallermtu == 0 && !empty($mtu)) $smallermtu = $mtu; else if (!empty($mtu) && $mtu < $smallermtu) @@ -340,16 +347,29 @@ function interface_bridge_configure(&$bridge) { if ($smallermtu == 0) $smallermtu = 1500; + $flags = 0; + if ($commonrx == false) + $flags |= -IFCAP_RXCSUM; + else + $flags |= IFCAP_RXCSUM; + if ($commontx == false) + $flags |= -IFCAP_TXCSUM; + else + $flags |= IFCAP_TXCSUM; + /* Add interfaces to bridge */ foreach ($members as $member) { if (!array_key_exists($member, $checklist)) continue; $realif1 = get_real_interface($member); $realif = escapeshellarg($realif1); - /* make sure the parent interface is up */ - pfSense_interface_mtu($realif, $smallermtu); - if(!$realif) + if (!$realif) { log_error("realif not defined in interfaces bridge - up"); + continue; + } + /* make sure the parent interface is up */ + pfSense_interface_mtu($realif1, $smallermtu); + pfSense_interface_capabilities($realif1, $flags); interfaces_bring_up($realif1); mwexec("/sbin/ifconfig {$bridgeif} addm {$realif}"); } |