Merge pull request #307 from casparsmit/patch-2

Add common spanning tree tunables for bridges
This commit is contained in:
Jamie Cameron
2016-04-12 19:20:43 -07:00
4 changed files with 24 additions and 0 deletions

View File

@@ -76,6 +76,15 @@ foreach $iface (@ifaces) {
elsif ($param eq 'bridge_ports') {
$cfg->{'bridgeto'} = $value;
}
elsif ($param eq 'bridge_stp') {
$cfg->{'bridgestp'} = $value;
}
elsif ($param eq 'bridge_fd') {
$cfg->{'bridgefd'} = $value;
}
elsif ($param eq 'bridge_waitport') {
$cfg->{'bridgewait'} = $value;
}
elsif ($param eq 'pre-up' &&
$value =~ /brctl\s+addif\s+br\d+\s+(\S+)/) {
$cfg->{'bridgeto'} = $1;
@@ -210,6 +219,9 @@ if ($cfg->{'bridge'}) {
else {
push(@options, [ 'pre-up', 'brctl addbr '.$name ]);
}
push(@options, [ 'bridge_stp', $cfg->{'bridgestp'} ]);
push(@options, [ 'bridge_fd', $cfg->{'bridgefd'} ]);
push(@options, [ 'bridge_waitport', $cfg->{'bridgewait'} ]);
}
# Set bonding parameters

View File

@@ -300,6 +300,12 @@ if ($in{'bridge'} || $b && $b->{'bridge'}) {
[ [ "", $text{'bifc_nobridge'} ],
@ethboot ],
1, 0, $in{'new'} ? 0 : 1));
print &ui_table_row($text{'bifc_bridgestp'},
&ui_radio("bridgestp", $b->{'bridgestp'} ? $b->{'bridgestp'} : "off", [["off", "Off"], ["on", "On"]]));
print &ui_table_row($text{'bifc_bridgefd'},
&ui_textbox("bridgefd", $b->{'bridgefd'} ? $b->{'bridgefd'} : "0", 3)." seconds");
print &ui_table_row($text{'bifc_bridgewait'},
&ui_textbox("bridgewait", $b->{'bridgewait'} ? $b->{'bridgewait'} : "0", 3)." seconds");
}
print &ui_table_end();

View File

@@ -109,6 +109,9 @@ bifc_nobridge=<None>
bifc_ebridgeto=An existing Ethernet interface must be selected for this bridge to use
bifc_ebridgeto2=The selected interface for the bridge must not have any address assigned
bifc_ebridge=Bridge interface must be a number
bifc_bridgestp=Spanning Tree Protocol
bifc_bridgefd=Forward Delay
bifc_bridgewait=Delay to become available
bifc_ebond=Bond interface must be a number
bonding_add=Add a new bonding Interface.

View File

@@ -311,6 +311,9 @@ else {
($bt->{'address'} || $bt->{'dhcp'} || $bt->{'bootp'}) &&
&error($text{'bifc_ebridgeto2'});
$b->{'bridgeto'} = $in{'bridgeto'};
$b->{'bridgestp'} = $in{'bridgestp'};
$b->{'bridgefd'} = $in{'bridgefd'};
$b->{'bridgewait'} = $in{'bridgewait'};
}
# Save the interface with its final name