2007-11-14 Jim Li <[email protected]>
authorjim
Thu, 15 Nov 2007 09:07:48 +0000
changeset 11195 69321dfcfbae
parent 11194 bb0991627b92
child 11196 5bac35d5162e
2007-11-14 Jim Li <[email protected]> * patches/gnome-system-tools-03-network.diff: Fix for Bug#6532839 which compare ip/netmask value between ifconfig -a's output and configure file, use previous value if they're different. * patches/system-tools-backends-04-network.diff:Fix for Bug#6532839 backend part of the fix.
ChangeLog
patches/gnome-system-tools-03-network.diff
patches/system-tools-backends-04-network.diff
--- a/ChangeLog	Thu Nov 15 08:23:01 2007 +0000
+++ b/ChangeLog	Thu Nov 15 09:07:48 2007 +0000
@@ -1,3 +1,11 @@
+2007-11-15  Jim Li  <[email protected]>
+
+	* patches/gnome-system-tools-03-network.diff: Fix for Bug#6532839
+          which compare ip/netmask value between ifconfig -a's output and
+          configuration file, use previous value if they're different.
+	* patches/system-tools-backends-04-network.diff: Fix for Bug#6532839
+          backend part of the fix.
+
 2007-11-15  Damien Carbery <[email protected]>
 
 	* closed/SUNWfsexam.spec: Correct dir ownership for %{_datadir}/idl.
--- a/patches/gnome-system-tools-03-network.diff	Thu Nov 15 08:23:01 2007 +0000
+++ b/patches/gnome-system-tools-03-network.diff	Thu Nov 15 09:07:48 2007 +0000
@@ -1,6 +1,6 @@
 diff -u gnome-system-tools-2.14.0/interfaces/network.glade.in-orig gnome-system-tools-2.14.0/interfaces/network.glade.in
---- gnome-system-tools-2.14.0/interfaces/network.glade.in-orig	2006-01-30 22:40:32.000000000 +0000
-+++ gnome-system-tools-2.14.0/interfaces/network.glade.in	2006-09-01 11:29:45.420297000 +0100
+--- gnome-system-tools-2.14.0/interfaces/network.glade.in-orig	2006-01-31 06:40:32.000000000 +0800
++++ gnome-system-tools-2.14.0/interfaces/network.glade.in	2007-11-14 16:23:54.107510000 +0800
 @@ -1240,7 +1240,7 @@
  			<widget class="GtkTable" id="table12">
  			  <property name="border_width">6</property>
@@ -44,8 +44,8 @@
  		    </widget>
 
 diff -u gnome-system-tools-2.14.0/src/network/callbacks.c-orig gnome-system-tools-2.14.0/src/network/callbacks.c
---- gnome-system-tools-2.14.0/src/network/callbacks.c-orig	2005-08-08 20:00:02.000000000 +0100
-+++ gnome-system-tools-2.14.0/src/network/callbacks.c	2006-09-04 11:12:49.195987000 +0100
+--- gnome-system-tools-2.14.0/src/network/callbacks.c-orig	2005-08-09 03:00:02.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/callbacks.c	2007-11-14 16:27:43.927717000 +0800
 @@ -35,7 +35,6 @@
    gboolean   success;
  
@@ -54,7 +54,18 @@
  
    if (!success)
      {
-@@ -342,7 +341,6 @@
+@@ -170,8 +169,9 @@
+   dialog = GST_NETWORK_TOOL (tool)->dialog;
+   gtk_widget_hide (dialog->dialog);
+ 
+-  if (dialog->changed)
++  if (dialog->changed || dialog->needsaved)
+     {
++      dialog->needsaved = FALSE;
+       connection_save (dialog);
+       selection = gtk_tree_view_get_selection (GST_NETWORK_TOOL (tool)->interfaces_list);
+ 
+@@ -342,7 +342,6 @@
        else
          {
  	  gst_iface_disable (iface);
@@ -62,10 +73,9 @@
  	}
  
        ifaces_model_modify_interface_at_iter (&iter);
-
 diff -u gnome-system-tools-2.14.0/src/network/connection.c-orig gnome-system-tools-2.14.0/src/network/connection.c
---- gnome-system-tools-2.14.0/src/network/connection.c-orig	2005-08-08 20:00:02.000000000 +0100
-+++ gnome-system-tools-2.14.0/src/network/connection.c	2006-09-01 12:11:59.485338000 +0100
+--- gnome-system-tools-2.14.0/src/network/connection.c-orig	2005-08-09 03:00:02.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/connection.c	2007-11-14 16:27:52.911896000 +0800
 @@ -117,6 +117,7 @@
  {
    g_object_set (G_OBJECT (dialog->iface),
@@ -74,7 +84,15 @@
  		"iface-netmask",   get_entry_text (dialog->netmask),
  		"iface-gateway",   get_entry_text (dialog->gateway),
  		"iface-bootproto", connection_get_bootproto (dialog),
-@@ -378,6 +379,7 @@
+@@ -366,6 +367,7 @@
+   gcd = g_new0 (GstConnectionDialog, 1);
+ 
+   gcd->standalone = FALSE;
++  gcd->needsaved = FALSE;
+   gcd->iface  = NULL;
+   gcd->dialog = gst_dialog_get_widget (tool->main_dialog, "connection_config_dialog");
+ 
+@@ -378,6 +380,7 @@
    gcd->options_page     = gst_dialog_get_widget (tool->main_dialog, "connection_options_page");
  
    gcd->connection_configured = gst_dialog_get_widget (tool->main_dialog, "connection_device_active");
@@ -82,7 +100,7 @@
    gcd->connection_device     = gst_dialog_get_widget (tool->main_dialog, "connection_device");
  
    gcd->connection_ppp_configured = gst_dialog_get_widget (tool->main_dialog, "connection_ppp_device_active");
-@@ -425,6 +427,7 @@
+@@ -425,6 +428,7 @@
  connection_dialog_prepare (GstConnectionDialog *dialog, GstIface *iface)
  {
    gboolean active;
@@ -90,7 +108,7 @@
  
    dialog->iface = g_object_ref (iface);
    active = gst_iface_is_configured (dialog->iface);
-@@ -473,6 +476,9 @@
+@@ -473,6 +477,9 @@
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->connection_configured),
  				    gst_iface_is_configured (iface));
  
@@ -100,7 +118,7 @@
        gtk_label_set_text (GTK_LABEL (dialog->connection_device),
  			  gst_iface_get_dev (iface));
  
-@@ -511,7 +517,7 @@
+@@ -511,7 +518,7 @@
  void
  connection_save (GstConnectionDialog *dialog)
  {
@@ -109,7 +127,7 @@
  
    if (GST_IS_IFACE_MODEM (dialog->iface)
        || GST_IS_IFACE_ISDN (dialog->iface))
-@@ -525,6 +531,7 @@
+@@ -525,6 +532,7 @@
    else
      {
        active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->connection_configured));
@@ -117,7 +135,7 @@
  
        if (GST_IS_IFACE_WIRELESS (dialog->iface))
          {
-@@ -536,6 +543,8 @@
+@@ -536,6 +544,8 @@
          ethernet_dialog_save (dialog);
        else if (GST_IS_IFACE_PLIP (dialog->iface))
          plip_dialog_save (dialog);
@@ -126,7 +144,7 @@
      }
  
    gst_iface_set_configured (dialog->iface, active);
-@@ -601,10 +610,11 @@
+@@ -601,10 +611,11 @@
  void
  connection_dialog_set_sensitive (GstConnectionDialog *dialog, gboolean active)
  {
@@ -144,11 +162,18 @@
 +  gtk_widget_set_sensitive (dialog->modem_page,         active);
 +  gtk_widget_set_sensitive (dialog->options_page,       active);
  }
-
 diff -u gnome-system-tools-2.14.0/src/network/connection.h-orig gnome-system-tools-2.14.0/src/network/connection.h
---- gnome-system-tools-2.14.0/src/network/connection.h-orig	2005-06-12 17:09:38.000000000 +0100
-+++ gnome-system-tools-2.14.0/src/network/connection.h	2006-09-01 11:50:57.158798000 +0100
-@@ -39,6 +39,7 @@
+--- gnome-system-tools-2.14.0/src/network/connection.h-orig	2005-06-13 00:09:38.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/connection.h	2007-11-14 16:27:55.839753000 +0800
+@@ -29,6 +29,7 @@
+   GstIface  *iface;
+   gboolean   changed;
+   gboolean   standalone;
++  gboolean   needsaved;
+   GtkWidget *dialog;
+ 
+   /* notebook pages */
+@@ -39,6 +40,7 @@
    GtkWidget *options_page;
  
    GtkWidget *connection_configured;
@@ -156,10 +181,9 @@
    GtkWidget *connection_device;
    GtkWidget *connection_ppp_configured;
    GtkWidget *connection_ppp_device;
-
 diff -u gnome-system-tools-2.14.0/src/network/main.c-orig gnome-system-tools-2.14.0/src/network/main.c
---- gnome-system-tools-2.14.0/src/network/main.c-orig	2005-08-08 20:00:02.000000000 +0100
-+++ gnome-system-tools-2.14.0/src/network/main.c	2006-09-01 12:12:42.058552000 +0100
+--- gnome-system-tools-2.14.0/src/network/main.c-orig	2005-08-09 03:00:02.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/main.c	2007-11-14 16:23:54.109341000 +0800
 @@ -60,6 +60,7 @@
    { "connection_address",           "focus-out-event", G_CALLBACK (on_ip_address_focus_out) },
    { "connection_ppp_device_active", "toggled", G_CALLBACK (on_dialog_changed) },
@@ -168,11 +192,9 @@
    { "connection_essid",             "changed", G_CALLBACK (on_dialog_changed) },
    { "connection_wep_key_type",      "changed", G_CALLBACK (on_dialog_changed) },
    { "connection_wep_key",           "changed", G_CALLBACK (on_dialog_changed) },
-
-
-diff -u gnome-system-tools-2.14.0/src/network/network-iface.c-fix gnome-system-tools-2.14.0/src/network/network-iface.c
---- gnome-system-tools-2.14.0/src/network/network-iface.c-fix	2006-10-25 09:32:30.429635000 +0100
-+++ gnome-system-tools-2.14.0/src/network/network-iface.c	2006-10-25 09:31:36.405921000 +0100
+diff -u gnome-system-tools-2.14.0/src/network/network-iface.c-orig gnome-system-tools-2.14.0/src/network/network-iface.c
+--- gnome-system-tools-2.14.0/src/network/network-iface.c-orig	2005-07-16 03:53:32.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/network-iface.c	2007-11-14 16:23:54.109793000 +0800
 @@ -281,6 +281,7 @@
  {
    gchar      *dev, *file, *hwaddr;
@@ -199,10 +221,52 @@
  		"iface-configured", (configuration != NULL),
  		NULL);
  
-diff -u ./src/network/network-iface-ethernet.c-clean ./src/network/network-iface-ethernet.c
---- ./src/network/network-iface-ethernet.c-clean	2006-05-12 16:12:39.198270000 +0100
-+++ ./src/network/network-iface-ethernet.c	2006-05-12 16:12:09.199304000 +0100
-@@ -372,9 +372,10 @@
+diff -u gnome-system-tools-2.14.0/src/network/network-iface-ethernet.c-orig gnome-system-tools-2.14.0/src/network/network-iface-ethernet.c
+--- gnome-system-tools-2.14.0/src/network/network-iface-ethernet.c-orig	2005-08-09 03:00:02.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/network-iface-ethernet.c	2007-11-14 16:28:08.320430000 +0800
+@@ -20,10 +20,13 @@
+ 
+ #include <glib.h>
+ #include <glib/gi18n.h>
++#include "gst-network-tool.h"
+ #include "network-iface-ethernet.h"
+ #include "network-iface.h"
+ #include "gst.h"
+ 
++extern GstTool *tool;
++
+ struct _GstIfaceEthernetPriv
+ {
+   gchar     *address;
+@@ -347,8 +350,9 @@
+ 					xmlNodePtr        node)
+ {
+   xmlNodePtr configuration;
+-  gchar *address, *netmask, *gateway, *bootproto;
++  gchar *address, *netmask, *gateway, *bootproto, *addr, *mask;
+   GstBootProto proto;
++  GstNetworkTool *network_tool;
+ 
+   g_return_if_fail (iface != NULL);
+   g_return_if_fail (node != NULL);
+@@ -368,13 +372,27 @@
+       address = gst_xml_get_child_content (configuration, "address");
+       netmask = gst_xml_get_child_content (configuration, "netmask");
+       gateway = gst_xml_get_child_content (configuration, "gateway");
++      addr = gst_xml_get_child_content (node, "addr");
++      mask = gst_xml_get_child_content (node, "mask");
++      if (address == NULL || netmask == NULL || strcmp (addr, address) != 0 || strcmp (mask, netmask ) != 0)
++        {
++	  network_tool = GST_NETWORK_TOOL (tool);
++	  network_tool->dialog->needsaved = TRUE;
++	  if ( address != NULL )
++	  	g_free (address);
++	  if ( netmask != NULL )
++	 	g_free (netmask);
++	  address = addr;
++	  netmask = mask;
++        }
+     }
    else
      {
        proto = GST_BOOTPROTO_DHCP;
@@ -216,10 +280,9 @@
      }
  
    g_object_set (G_OBJECT (iface),
-
-diff -u ./src/network/network-iface-irlan.c-clean ./src/network/network-iface-irlan.c
---- ./src/network/network-iface-irlan.c-clean	2006-05-12 16:22:47.233584000 +0100
-+++ ./src/network/network-iface-irlan.c	2006-04-24 12:47:53.655025000 +0100
+diff -u gnome-system-tools-2.14.0/src/network/network-iface-irlan.c-orig gnome-system-tools-2.14.0/src/network/network-iface-irlan.c
+--- gnome-system-tools-2.14.0/src/network/network-iface-irlan.c-orig	2005-08-09 03:00:03.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/network-iface-irlan.c	2007-11-14 16:23:54.110489000 +0800
 @@ -25,6 +25,9 @@
  #include "gst.h"
  
@@ -230,10 +293,9 @@
  };
  
  static void gst_iface_irlan_class_init (GstIfaceIrlanClass *class);
-
 diff -u gnome-system-tools-2.14.0/src/network/transfer.c-orig gnome-system-tools-2.14.0/src/network/transfer.c
---- gnome-system-tools-2.14.0/src/network/transfer.c-orig	2004-12-21 16:17:15.000000000 +0000
-+++ gnome-system-tools-2.14.0/src/network/transfer.c	2007-02-02 13:55:04.244291000 +0000
+--- gnome-system-tools-2.14.0/src/network/transfer.c-orig	2004-12-22 00:17:15.000000000 +0800
++++ gnome-system-tools-2.14.0/src/network/transfer.c	2007-11-14 16:23:54.110774000 +0800
 @@ -101,10 +101,14 @@
    gchar      *gatewaydev = gateways_combo_get_selected ();
    xmlNodePtr  node       = gst_xml_element_find_first (root, "gatewaydev");
@@ -252,4 +314,3 @@
  
    g_free (gatewaydev);
  }
-
--- a/patches/system-tools-backends-04-network.diff	Thu Nov 15 08:23:01 2007 +0000
+++ b/patches/system-tools-backends-04-network.diff	Thu Nov 15 09:07:48 2007 +0000
@@ -1,6 +1,6 @@
-diff -ru /var/tmp/clean/system-tools-backends-1.4.2/network-conf.in system-tools-backends-1.4.2/network-conf.in
---- /var/tmp/clean/system-tools-backends-1.4.2/network-conf.in	2006-01-02 15:32:33.000000000 +0000
-+++ system-tools-backends-1.4.2/network-conf.in	2006-03-13 10:14:56.148512000 +0000
+diff -u system-tools-backends-1.4.2/network-conf.in-orig system-tools-backends-1.4.2/network-conf.in
+--- system-tools-backends-1.4.2/network-conf.in-orig	2006-01-02 23:32:33.000000000 +0800
++++ system-tools-backends-1.4.2/network-conf.in	2007-11-14 16:37:01.774181000 +0800
 @@ -77,7 +77,8 @@
                "vine-3.0", "vine-3.1",
                "ark", 
@@ -11,9 +11,9 @@
  
  $description =<<"end_of_description;";
         Configures all network parameters and interfaces.
-
---- system-tools-backends-1.4.2.orig/network.pl.in	Mon Jan  2 23:50:54 2006
-+++ system-tools-backends-1.4.2/network.pl.in	Thu Feb  8 20:17:02 2007
+diff -u system-tools-backends-1.4.2/network.pl.in-orig system-tools-backends-1.4.2/network.pl.in
+--- system-tools-backends-1.4.2/network.pl.in-orig	2006-01-02 23:50:54.000000000 +0800
++++ system-tools-backends-1.4.2/network.pl.in	2007-11-15 16:23:10.258029000 +0800
 @@ -28,8 +28,10 @@
  use Socket;
  
@@ -25,7 +25,7 @@
    $SCRIPTSDIR = ".";
    $DOTIN = ".in";
  }
-@@ -117,6 +119,455 @@
+@@ -117,6 +119,457 @@
    return \@ifaces;
  }
  
@@ -127,6 +127,8 @@
 +    if ( $output ne "" ) {
 +        return $output;
 +    }
++  } elsif (($buf = &gst_network_get_default_gateway ()) ne NULL) {
++	return $buf;
 +  }
 +  return "";
 +}
@@ -481,7 +483,7 @@
  # Returns an array with the wireless devices found
  sub gst_network_get_wireless_ifaces
  {
-@@ -124,6 +575,7 @@
+@@ -124,6 +577,7 @@
      
    return &gst_network_get_linux_wireless_ifaces   if ($plat eq "Linux");
    return &gst_network_get_freebsd_wireless_ifaces if ($plat eq "FreeBSD");
@@ -489,7 +491,7 @@
  }
  
  # set of functions for enabling an interface
-@@ -138,23 +590,39 @@
+@@ -138,39 +592,81 @@
  
    if ($essid)
    {
@@ -541,7 +543,6 @@
    }
  }
  
-@@ -161,17 +629,43 @@
  sub gst_network_enable_iface
  {
    my ($hash, $dev, $command_ifconfig) = @_;
@@ -561,7 +562,7 @@
    {
 -    if (&gst_file_locate_tool ("dhclient3"))
 +    if ($$tool{"system"} eq "SunOS")
-     {
++    {
 +
 +      &gst_file_run ("ifconfig $dev plumb"); # XXX - inet6???
 +      if (&gst_network_get_interface_type($dev) eq "wireless" ) {
@@ -583,11 +584,10 @@
 +      &gst_file_run ("cp -p $resolv_conf $SYSCONFDIR/inet/gnome-system-tools/resolv.conf.$dev.bak");
 +    }
 +    elsif (&gst_file_locate_tool ("dhclient3"))
-+    {
+     {
        $command = "dhclient3 -pf /var/run/dhclient.$dev.pid $dev";
      }
-     elsif (&gst_file_locate_tool ("dhclient"))
-@@ -189,11 +683,36 @@
+@@ -189,11 +685,36 @@
      $command .= " $dev";
      $command .= " $address" if ($address);
      $command .= " netmask $netmask" if ($netmask);
@@ -626,7 +626,7 @@
  }
  
  sub gst_network_get_chat_file
-@@ -352,6 +871,10 @@
+@@ -352,6 +873,10 @@
    {
      @arr = ("/dev/modem", "/dev/cuaa0", "/dev/cuaa1", "/dev/cuaa2", "/dev/cuaa3");
    }
@@ -637,7 +637,7 @@
    
    foreach $tty (@arr) {
      $temp = `pppd lcp-max-configure 1 nodetach noauth nocrtscts $tty connect \"chat -t1 \'\' AT OK\" 2>/dev/null`;
-@@ -480,7 +1003,9 @@
+@@ -480,7 +1005,9 @@
    my %cmd_map =
        (
         "debian-2.2" => "ping -c 2 -i 1 -n $bcast",
@@ -648,7 +648,7 @@
         );
    my %dist_map =
        (
-@@ -499,6 +1024,8 @@
+@@ -499,6 +1026,8 @@
         "ubuntu-5.04"  => "debian-2.2",
         "ubuntu-5.10"  => "debian-2.2",
         "ubuntu-6.04"  => "debian-2.2",
@@ -657,7 +657,7 @@
         "mandrake-7.1" => "debian-2.2",
         "mandrake-7.2" => "debian-2.2",
         "mandrake-9.0" => "debian-2.2",
-@@ -778,6 +1305,8 @@
+@@ -778,6 +1307,8 @@
  {
    my ($dev) = @_;
    my (@wireless_ifaces, $wi, $type);
@@ -666,7 +666,7 @@
  
    return $types_cache{$dev} if (exists $types_cache{$dev});
  
-@@ -804,7 +1333,7 @@
+@@ -804,7 +1335,7 @@
        $types_cache{$dev} = "modem";
      }
    }
@@ -675,7 +675,7 @@
    {
      $types_cache{$dev} = "ethernet";
    }
-@@ -820,6 +1349,19 @@
+@@ -820,6 +1351,19 @@
    {
      $types_cache{$dev} = "loopback";
    }
@@ -695,7 +695,7 @@
  
    return $types_cache{$dev};
  }
-@@ -895,6 +1437,62 @@
+@@ -895,12 +1439,73 @@
    return \%ifaces;
  }
  
@@ -746,6 +746,10 @@
 +      $ifaces{$dev}{"addr"}    = $1 if /inet[ \t]+([^ \t]+)/i;
 +      $ifaces{$dev}{"mask"}    = $1 if /netmask[ \t]+([^ \t]+)/i;
 +      $ifaces{$dev}{"bcast"}   = $1 if /broadcast[ \t]+([^ \t]+)/i;
++      if ( $ifaces{$dev}{"mask"} =~ /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ )
++       {
++        $ifaces{$dev}{"mask"} = sprintf ("%d.%d.%d.%d", hex($1), hex($2), hex($3), hex($4));
++       }
 +    }
 +  }
 +  
@@ -758,7 +762,6 @@
  sub gst_network_interfaces_get_info
  {
    my (%ifaces);
-@@ -901,6 +1499,7 @@
  
    $ifaces = &gst_network_linux_interfaces_get_info   if ($$tool{"system"} eq "Linux");
    $ifaces = &gst_network_freebsd_interfaces_get_info if ($$tool{"system"} eq "FreeBSD");
@@ -766,7 +769,7 @@
  
    foreach $dev (keys %$ifaces)
    {
-@@ -925,12 +1524,18 @@
+@@ -925,12 +1530,18 @@
    &gst_report_enter ();
    &gst_report ("network_iface_active_get");
  
@@ -786,7 +789,7 @@
      s/:? .*//;
      next if /^$/;
      push @ret, $_;
-@@ -1182,6 +1787,208 @@
+@@ -1182,6 +1793,208 @@
    return @ret;
  }
  
@@ -995,7 +998,17 @@
  sub gst_network_suse70_parse_iface_num
  {
    my ($file, $dev) = @_;
-@@ -1672,7 +2479,7 @@
+@@ -1637,9 +2450,7 @@
+   # clear unneeded hash elements
+   foreach $i (keys %$hash)
+   {
+-    delete $$hash{$i}{"addr"};
+     delete $$hash{$i}{"bcast"};
+-    delete $$hash{$i}{"mask"};
+   }
+ 
+   foreach $i (@ifaces)
+@@ -1672,7 +2483,7 @@
    $dev = "ppp0" if ($$tool{"system"} eq "Linux");
    $dev = "tun0" if ($$tool{"system"} eq "FreeBSD");
  
@@ -1004,7 +1017,7 @@
    {
      $$hash{$dev}{"dev"} = $dev;
      $$hash{$dev}{"enabled"} = 0;
-@@ -1683,6 +2490,63 @@
+@@ -1683,6 +2494,63 @@
    return \%$hash;
  }
  
@@ -1068,7 +1081,7 @@
  sub gst_network_conf_get
  {
    my %dist_attrib;
-@@ -1743,6 +2607,12 @@
+@@ -1743,6 +2611,12 @@
    return "$dev.$i";
  }
  
@@ -1081,7 +1094,7 @@
  sub gst_network_deb22_get_file
  {
    my ($iface) = @_;
-@@ -1816,6 +2686,8 @@
+@@ -1816,6 +2690,8 @@
            "ubuntu-5.04" => \&gst_network_deb22_get_file,    
            "ubuntu-5.10" => \&gst_network_deb22_get_file,    
            "ubuntu-6.04" => \&gst_network_deb22_get_file,    
@@ -1090,7 +1103,7 @@
            "suse-7.0"     => \&gst_network_suse70_get_file,
            "suse-9.0"     => \&gst_network_deb22_get_file,
            "suse-9.1"     => \&gst_network_deb22_get_file,
-@@ -1851,6 +2723,15 @@
+@@ -1851,6 +2727,15 @@
  
  sub gst_network_get_gateway_data
  {
@@ -1106,7 +1119,7 @@
    my ($fd, $gateway, $dev);
  
    $fd = &gst_file_run_pipe_read ("route -n");
-@@ -1868,6 +2749,25 @@
+@@ -1868,6 +2753,25 @@
    return ($gateway, $dev);
  }
  
@@ -1117,7 +1130,7 @@
 +  $fd = &gst_file_run_pipe_read ("netstat -rn");
 +  while (<$fd>)
 +  {
-+    if (/^default[ \t]+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)[ \t]+.*[ \t]([a-zA-Z0-9]*)/)
++    if (/^default[ \t]+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)[ \t]+.*[ \t]([a-zA-Z0-9]*[0-9])/)
 +    {
 +      $gateway = $1;
 +      $dev = $2;
@@ -1132,7 +1145,7 @@
  sub gst_network_get_default_gatewaydev
  {
    my ($gateway, $dev) = &gst_network_get_gateway_data ();
-@@ -1890,10 +2790,15 @@
+@@ -1890,10 +2794,15 @@
    # Just in case. This means that no static gateway is needed.
    return if $gateway eq "";
  
@@ -1150,7 +1163,7 @@
      {
        $curr_gateway = $1;
        if ($gatewaydev ne "")
-@@ -1910,8 +2815,14 @@
+@@ -1910,8 +2819,14 @@
    if (($curr_gateway    ne $gateway) ||
        ($curr_gatewaydev ne $gatewaydev))
    {
@@ -1167,7 +1180,7 @@
    }
  }
  
-@@ -3822,28 +4733,57 @@
+@@ -3822,28 +4737,57 @@
    return $dev;
  }
  
@@ -1237,7 +1250,7 @@
  
    return \@arr;
  }
-@@ -3936,6 +4876,8 @@
+@@ -3936,6 +4880,8 @@
            "ubuntu-5.04" => "lo",    
            "ubuntu-5.10" => "lo",    
            "ubuntu-6.04" => "lo",    
@@ -1246,7 +1259,7 @@
            "suse-7.0"     => "",
            "suse-9.0"     => "",
            "suse-9.1"     => "",
-@@ -3970,7 +4912,7 @@
+@@ -3970,7 +4916,7 @@
      my %iface = (
                   "auto" => 1,
                   "user" => 0,
@@ -1255,7 +1268,7 @@
                   "address" => "127.0.0.1",
                   "netmask" => "255.0.0.0",
                   "broadcast" => "127.255.255.255",
-@@ -4101,6 +5043,8 @@
+@@ -4101,6 +5047,8 @@
            "ubuntu-5.04" => "debian-2.2",
            "ubuntu-5.10" => "debian-2.2",
            "ubuntu-6.04" => "debian-2.2",
@@ -1264,7 +1277,7 @@
            "suse-7.0"     => "suse-7.0",
            "suse-9.0"     => "suse-9.0",
            "suse-9.1"     => "suse-9.0",
-@@ -4479,6 +5423,79 @@
+@@ -4479,6 +5427,79 @@
         [ "gatewaydev",    \&gst_network_get_gateway_dev_from_address, "%interface%", "%gateway%" ],
         ]
       },
@@ -1344,7 +1357,7 @@
     );
    
    my $dist = $dist_map{$gst_dist};
-@@ -4522,6 +5539,8 @@
+@@ -4522,6 +5543,8 @@
            "ubuntu-5.04" => "debian-3.0",
            "ubuntu-5.10" => "debian-3.0",
            "ubuntu-6.04" => "debian-3.0",
@@ -1353,7 +1366,7 @@
            "suse-7.0"     => "suse-7.0",
            "suse-9.0"     => "suse-9.0",
            "suse-9.1"     => "suse-9.0",
-@@ -5318,7 +6337,115 @@
+@@ -5318,7 +6341,115 @@
         [ "persist",            \&gst_network_get_freebsd5_ppp_persist, [ STARTIF, IFACE ]],
        ]
      },
@@ -1470,7 +1483,7 @@
    
    my $dist = $dist_map{$gst_dist};
    return %{$dist_tables{$dist}} if $dist;
-@@ -5360,6 +6487,8 @@
+@@ -5360,6 +6491,8 @@
            "ubuntu-5.04" => "debian-2.2",
            "ubuntu-5.10" => "debian-2.2",
            "ubuntu-6.04" => "debian-2.2",
@@ -1479,7 +1492,7 @@
            "suse-7.0"     => "suse-7.0",
            "suse-9.0"     => "suse-9.0",
            "suse-9.1"     => "suse-9.0",
-@@ -5723,7 +6852,69 @@
+@@ -5723,7 +6856,69 @@
         [ "gateway",       \&gst_replace_sh,               RC_CONF, "defaultrouter" ],
         [ "interface",     \&gst_network_interfaces_set,   OLD_HASH ]
         ]
@@ -1550,7 +1563,7 @@
  	  );
    
    my $dist = $dist_map{$gst_dist};
-@@ -5766,6 +6957,8 @@
+@@ -5766,6 +6961,8 @@
            "ubuntu-5.04" => "debian-3.0",
            "ubuntu-5.10" => "debian-3.0",
            "ubuntu-6.04" => "debian-3.0",
@@ -1559,7 +1572,7 @@
            "suse-7.0"     => "suse-7.0",
            "suse-9.0"     => "suse-9.0",
            "suse-9.1"     => "suse-9.0",
-@@ -6522,7 +7715,109 @@
+@@ -6522,7 +7719,109 @@
         [ "dial_command",   \&gst_network_replace_pppconf_dial_command, [ PPPCONF, STARTIF, IFACE ]],
         [ "volume",         \&gst_network_replace_pppconf_volume,       [ PPPCONF, STARTIF, IFACE ]],
        ]