$canno = 1;
}
@opts = ( );
+if ($canno) {
+ push(@opts, [ "none", $text{'ifcs_noaddress'} ]);
+ }
if ($dhcp) {
push(@opts, [ "dhcp", $text{'ifcs_dhcp'} ]);
}
push(@grid, $text{'ifcs_broad'}, "<tt>$b->{'broadcast'}</tt>");
}
push(@opts, [ "address", $text{'ifcs_static2'}, &ui_grid_table(\@grid, 2) ]);
-if ($canno) {
- push(@opts, [ "none", $text{'ifcs_noaddress'} ]);
- }
# Show the IP field
if (@opts > 1) {
@ethboot = map { $_->{'fullname'} }
grep { $_->{'fullname'} =~ /^eth(\d+)$/ } @boot;
print &ui_table_row($text{'bifc_bridgeto'},
- &ui_select("bridgeto", $b->{'bridgeto'}, \@ethboot));
+ &ui_select("bridgeto", $b->{'bridgeto'}, \@ethboot, 1, 0,
+ $in{'new'} ? 0 : 1));
}
print &ui_table_end();
}
$conf{'NAME'} = $_[0]->{'desc'};
&write_env_file("$net_scripts_dir/ifcfg-$name", \%conf);
+
+# If this is a bridge, set BRIDGE in real interface
+# XXX fix old one?
+if ($_[0]->{'bridge'}) {
+ local %bconf;
+ &lock_file("$net_scripts_dir/ifcfg-$_[0]->{'bridgeto'}");
+ &read_env_file("$net_scripts_dir/ifcfg-$_[0]->{'bridgeto'}", \%bconf);
+ $bconf{'BRIDGE'} = $_[0]->{'fullname'};
+ &write_env_file("$net_scripts_dir/ifcfg-$_[0]->{'bridgeto'}", \%bconf);
+ &unlock_file("$net_scripts_dir/ifcfg-$_[0]->{'bridgeto'}");
+ }
+
+# Link to devices directory
if (-d &translate_filename($devices_dir)) {
&link_file("$net_scripts_dir/ifcfg-$name",
"$devices_dir/ifcfg-$name");