Hey everyone :)

The attached patch makes the MTU of an interface configurable via YaPI.

Note that it only applies cleanly on top of my other patch
(fix-setting-ip-using-YaPI.patch). If you prefer not to merge that
patch right now, I can also send a diff against svn head.

Cheers,
Justus
-- 
Justus Winter                               [email protected]

PRESENSE Technologies GmbH            Sachsenstr. 5, D-20097 HH
                                         USt-IdNr.: DE263765024
Geschäftsführer/Managing Directors       AG Hamburg, HRB 107844
Till Dörges           Jürgen Sander              Axel Theilmann

# HG changeset patch
# Parent 9992869904f3ff0c507b65a12c856a6f1c0bb7bd
diff -r 9992869904f3 -r 7c3537b3d825 network/src/lan/YaPI/NETWORK.pm
--- a/network/src/lan/YaPI/NETWORK.pm	Mon Jul 25 17:13:30 2011 +0200
+++ b/network/src/lan/YaPI/NETWORK.pm	Mon Jul 25 17:40:10 2011 +0200
@@ -40,6 +40,7 @@
                 %configuration = ( 'bootproto' => 'static' );
                 $configuration{'ipaddr'} = LanItems->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"};
@@ -149,7 +150,8 @@
         my %config=("STARTMODE" => "auto",
                     "BOOTPROTO" => $args->{'interface'}->{$dev}->{'bootproto'},
                     "IPADDR" => $ip_row[0],
-                    "PREFIXLEN" => $prefix
+                    "PREFIXLEN" => $prefix,
+                    "MTU" => $args->{'interface'}->{$dev}->{'mtu'}
             );
         NetworkInterfaces->Current(\%config);
         NetworkInterfaces->Commit();
diff -r 9992869904f3 -r 7c3537b3d825 network/testsuite/tests/Network_YaPI.out
--- a/network/testsuite/tests/Network_YaPI.out	Mon Jul 25 17:13:30 2011 +0200
+++ b/network/testsuite/tests/Network_YaPI.out	Mon Jul 25 17:40:10 2011 +0200
@@ -15,9 +15,10 @@
 Dir	.network.section: ["eth0", "eth1"]
 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"
 Read	.target.size "/etc/install.inf" 27
 Dir	.etc.install_inf: []
 Read	.target.string "/proc/cmdline" "laptop.suse.cz"
@@ -33,7 +34,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"]], "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"]], "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"]]
diff -r 9992869904f3 -r 7c3537b3d825 network/testsuite/tests/Network_YaPI.ycp
--- a/network/testsuite/tests/Network_YaPI.ycp	Mon Jul 25 17:13:30 2011 +0200
+++ b/network/testsuite/tests/Network_YaPI.ycp	Mon Jul 25 17:40:10 2011 +0200
@@ -33,7 +33,8 @@
 		  ],
 	        "eth1" : $[
 		    "BOOTPROTO" : "static",
-		    "IPADDR"	: "1.2.3.4/24"
+		    "IPADDR"	: "1.2.3.4/24",
+		    "MTU"       : "1234"
 		  ]],
     ],
     "routes" : [ $["destination":"default", "gateway":"10.20.30.40"] ]

Attachment: signature.asc
Description: PGP signature

Reply via email to