Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65340 - in /trunk/network: src/lan/YaPI/NETWORK.pm testsuite/tests/Network_YaPI.out testsuite/tests/Network_YaPI.ycp
Author: mvidner
Date: Fri Aug 12 16:46:58 2011
New Revision: 65340

URL: http://svn.opensuse.org/viewcvs/yast?rev=65340&view=rev
Log:
Make MTU configurable using YaPI.

Based on a patch by Justus Winter
http://lists.opensuse.org/yast-devel/2011-07/msg00038.html

Modified:
trunk/network/src/lan/YaPI/NETWORK.pm
trunk/network/testsuite/tests/Network_YaPI.out
trunk/network/testsuite/tests/Network_YaPI.ycp

Modified: trunk/network/src/lan/YaPI/NETWORK.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/YaPI/NETWORK.pm?rev=65340&r1=65339&r2=65340&view=diff
==============================================================================
--- trunk/network/src/lan/YaPI/NETWORK.pm (original)
+++ trunk/network/src/lan/YaPI/NETWORK.pm Fri Aug 12 16:46:58 2011
@@ -44,6 +44,7 @@
$configuration{'ipaddr'} .= "/" . LanItems->prefix
}
}
+ $configuration{'mtu'} = LanItems->mtu;
$interfaces{LanItems->interfacename}=\%configuration;
} elsif (LanItems->getCurrentItem()->{'hwinfo'}->{'type'} eq "eth") {
my $device = LanItems->getCurrentItem()->{"hwinfo"}->{"dev_name"};
@@ -136,12 +137,12 @@
my $args = shift;
my $ret = {'exit'=>0, 'error'=>''};
y2milestone("interface", Dumper(\$args->{'interface'}));
- foreach my $dev (keys %{$args->{'interface'}}){
+ while (my ($dev, $ifc) = each %{$args->{'interface'}}) {
YaST::YCP::Import ("NetworkInterfaces");
NetworkInterfaces->Read();
NetworkInterfaces->Add() unless NetworkInterfaces->Edit($dev);
NetworkInterfaces->Name($dev);
- my $ip = $args->{'interface'}->{$dev}->{'ipaddr'};
+ my $ip = $ifc->{'ipaddr'};
my $prefix="32";
YaST::YCP::Import ("Netmask");
my @ip_row = split(/\//, $ip);
@@ -152,9 +153,12 @@
}
$ip = $ip_row[0]."/".$prefix;
my %config=("STARTMODE" => "auto",
- "BOOTPROTO" => $args->{'interface'}->{$dev}->{'bootproto'},
+ "BOOTPROTO" => $ifc->{'bootproto'},
"IPADDR" => $ip
);
+ if (defined $ifc->{'mtu'}) {
+ $config{"MTU"} = $ifc->{'mtu'};
+ }
NetworkInterfaces->Current(\%config);
NetworkInterfaces->Commit();
NetworkInterfaces->Write("");

Modified: trunk/network/testsuite/tests/Network_YaPI.out
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/testsuite/tests/Network_YaPI.out?rev=65340&r1=65339&r2=65340&view=diff
==============================================================================
--- trunk/network/testsuite/tests/Network_YaPI.out (original)
+++ trunk/network/testsuite/tests/Network_YaPI.out Fri Aug 12 16:46:58 2011
@@ -15,9 +15,10 @@
Dir .network.section: ["eth0", "eth1", "eth2", "eth3", "eth4"]
Dir .network.value."eth0": ["BOOTPROTO"]
Read .network.value."eth0".BOOTPROTO "dhcp4"
-Dir .network.value."eth1": ["BOOTPROTO", "IPADDR"]
+Dir .network.value."eth1": ["BOOTPROTO", "IPADDR", "MTU"]
Read .network.value."eth1".BOOTPROTO "static"
Read .network.value."eth1".IPADDR "1.2.3.4/24"
+Read .network.value."eth1".MTU "1234"
Dir .network.value."eth2": ["BOOTPROTO", "IPADDR", "PREFIXLEN"]
Read .network.value."eth2".BOOTPROTO "static"
Read .network.value."eth2".IPADDR "1.2.3.5/24"
@@ -45,7 +46,7 @@
Read .target.lstat "/etc/sysconfig/network/ifcfg-tr-usb" nil
Execute .target.bash_output "hostname --fqdn" $["exit":0,
"stdout":"laptop.suse.cz"]
Execute .target.bash_output "hostname --fqdn" $["exit":0,
"stdout":"laptop.suse.cz"]
-Return $["dns":$["nameservers":["208.67.222.222", "208.67.220.220"],
"searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1",
"domain":"suse.cz", "name":"laptop"],
"interfaces":$["eth0":$["bootproto":"dhcp4"], "eth1":$["bootproto":"static",
"ipaddr":"1.2.3.4/24"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24"],
"eth3":$["bootproto":"static", "ipaddr":"1.2.3.6/24"],
"eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24"]],
"routes":$["default":$["via":"10.20.30.40"]]]
+Return $["dns":$["nameservers":["208.67.222.222", "208.67.220.220"],
"searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1",
"domain":"suse.cz", "name":"laptop"],
"interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":""],
"eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234"],
"eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":""],
"eth3":$["bootproto":"static", "ipaddr":"1.2.3.6/24", "mtu":""],
"eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":""]],
"routes":$["default":$["via":"10.20.30.40"]]]
Return $["error":"", "exit":"0"]
Read .target.size "/etc/sysconfig/network/routes" 27
Read .routes [$["destination":"default", "gateway":"10.20.30.40"]]
@@ -84,4 +85,4 @@
Read .target.lstat "/etc/sysconfig/network/ifcfg-tr-usb" nil
Execute .target.bash_output "hostname --fqdn" $["exit":0,
"stdout":"laptop.suse.cz"]
Execute .target.bash_output "hostname --fqdn" $["exit":0,
"stdout":"laptop.suse.cz"]
-Return $["dns":$["nameservers":["208.67.222.222", "208.67.220.220"],
"searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1",
"domain":"suse.cz", "name":"laptop"],
"interfaces":$["eth0":$["bootproto":"dhcp4"], "eth1":$["bootproto":"static",
"ipaddr":"1.2.3.4/24"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24"],
"eth3":$["bootproto":"static", "ipaddr":"1.2.3.7/24"],
"eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24"]],
"routes":$["default":$["via":"10.20.30.40"]]]
+Return $["dns":$["nameservers":["208.67.222.222", "208.67.220.220"],
"searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1",
"domain":"suse.cz", "name":"laptop"],
"interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":""],
"eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234"],
"eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":""],
"eth3":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":""],
"eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":""]],
"routes":$["default":$["via":"10.20.30.40"]]]

Modified: trunk/network/testsuite/tests/Network_YaPI.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/testsuite/tests/Network_YaPI.ycp?rev=65340&r1=65339&r2=65340&view=diff
==============================================================================
--- trunk/network/testsuite/tests/Network_YaPI.ycp (original)
+++ trunk/network/testsuite/tests/Network_YaPI.ycp Fri Aug 12 16:46:58 2011
@@ -39,7 +39,8 @@
],
"eth1" : $[
"BOOTPROTO" : "static",
- "IPADDR" : "1.2.3.4/24"
+ "IPADDR" : "1.2.3.4/24",
+ "MTU" : "1234",
],
"eth2" : $[
"BOOTPROTO" : "static",

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages