[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#588761: marked as done (netcfg: please include Hurd support)



Your message dated Fri, 06 Aug 2010 16:19:00 +0000
with message-id <E1OhPdM-00040M-EZ@franck.debian.org>
and subject line Bug#588761: fixed in netcfg 1.55
has caused the Debian Bug report #588761,
regarding netcfg: please include Hurd support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
588761: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588761
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: netcfg
Version: 1.54
Tags: patch
Usertags: gsoc2010

NB: Please don't care -- I'll ask Samuel Thibault (my GSoC mentor) to
commit most of my changes, including those, and ask debian-boot to
review the more intrusive ones later, in one run. Of course I welcome
any kind of comments nonetheless.

Anyway, the attached patch makes netcfg-static work on Hurd.

Thanks,
-- 
Jeremie Koenig <jk@jk.fr.eu.org>
http://jk.fr.eu.org
Index: netcfg/debian/changelog
===================================================================
--- netcfg/debian/changelog	(revision 63843)
+++ netcfg/debian/changelog	(working copy)
@@ -1,3 +1,10 @@
+netcfg (1.55) UNRELEASED; urgency=low
+
+  * More fixes for Hurd support, including network device detection
+    (closes: <please fill-in>).
+
+ -- Jeremie Koenig <jk@jk.fr.eu.org>  Sun, 11 Jul 2010 22:51:56 +0000
+
 netcfg (1.54) unstable; urgency=low
 
   [ Samuel Thibault ]
Index: netcfg/static.c
===================================================================
--- netcfg/static.c	(revision 63843)
+++ netcfg/static.c	(working copy)
@@ -274,20 +274,22 @@
     char ptr1[INET_ADDRSTRLEN];
 
 #ifdef __GNU__
-    di_exec_shell_log("settrans /servers/socket/2 -fg");
     snprintf(buf, sizeof(buf),
              "settrans -fgap /servers/socket/2 /hurd/pfinet --interface=%s --address=%s",
              interface, inet_ntop (AF_INET, &ipaddress, ptr1, sizeof (ptr1)));
     di_snprintfcat(buf, sizeof(buf), " --netmask=%s",
                    inet_ntop (AF_INET, &netmask, ptr1, sizeof (ptr1)));
-    buf[sizeof(buf) - 1] = '\0';
 
     if (gateway.s_addr)
-        snprintf(buf, sizeof(buf), " --gateway=%s",
-                 inet_ntop (AF_INET, &gateway, ptr1, sizeof (ptr1)));
+        di_snprintfcat(buf, sizeof(buf), " --gateway=%s",
+                       inet_ntop (AF_INET, &gateway, ptr1, sizeof (ptr1)));
 
-    rv |= di_exec_shell_log(buf);
+    buf[sizeof(buf) - 1] = '\0';
 
+    /* NB: unfortunately we cannot use di_exec_shell_log() here, as the active
+     * translator would capture its pipe and make it hang forever. */
+    rv |= di_exec_shell(buf);
+
 #elif defined(__FreeBSD_kernel__)
     deconfigure_network();
     
Index: netcfg/netcfg-common.c
===================================================================
--- netcfg/netcfg-common.c	(revision 63843)
+++ netcfg/netcfg-common.c	(working copy)
@@ -229,8 +229,52 @@
     return strcmp(*ia, *ib);
 }
 
+#ifdef __GNU__
+#include <mach.h>
+#include <device/device.h>
+#include <hurd.h>
+/* Unfortunately, getifaddrs() does not work on Hurd, so we try possible names
+ * for network interfaces and check whether they exists by attempting to open
+ * the kernel device. */
 int get_all_ifs (int all, char*** ptr)
 {
+    static const char *const fmt[] = { "eth%d", "wl%d", NULL };
+
+    mach_port_t device_master;
+    device_t device;
+    int err;
+    char **list;
+    int num, i, j;
+    char name[5 + 3 * sizeof (int)];
+
+    err = get_privileged_ports (0, &device_master);
+    if (err)
+	return 0;
+
+    num = 0;
+    list = malloc(sizeof *list);
+    for (i = 0; fmt[i]; i++)
+	for (j = 0; 1; j++) {
+	    sprintf (name, fmt[i], j);
+	    err = device_open (device_master, D_READ, name, &device);
+	    if (err != 0)
+		break;
+
+	    device_close (device);
+	    mach_port_deallocate (mach_task_self (), device);
+
+	    list = realloc (list, (num + 2) * sizeof *list);
+	    list[num++] = strdup(name);
+	}
+    list[num] = NULL;
+
+    mach_port_deallocate (mach_task_self (), device_master);
+    *ptr = list;
+    return num;
+}
+#else
+int get_all_ifs (int all, char*** ptr)
+{
     struct ifaddrs *ifap, *ifa;
     char ibuf[512];
     char** list = NULL;
@@ -279,6 +323,7 @@
 
     return len;
 }
+#endif
 
 #ifdef __linux__
 short find_in_stab(const char* iface)

--- End Message ---
--- Begin Message ---
Source: netcfg
Source-Version: 1.55

We believe that the bug you reported is fixed in the latest version of
netcfg, which is due to be installed in the Debian FTP archive:

netcfg-static_1.55_amd64.udeb
  to main/n/netcfg/netcfg-static_1.55_amd64.udeb
netcfg_1.55.dsc
  to main/n/netcfg/netcfg_1.55.dsc
netcfg_1.55.tar.gz
  to main/n/netcfg/netcfg_1.55.tar.gz
netcfg_1.55_amd64.udeb
  to main/n/netcfg/netcfg_1.55_amd64.udeb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 588761@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@debian.org> (supplier of updated netcfg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 06 Aug 2010 17:54:02 +0200
Source: netcfg
Binary: netcfg netcfg-static
Architecture: source amd64
Version: 1.55
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Description: 
 netcfg     - Configure the network (udeb)
 netcfg-static - Configure a static network (udeb)
Closes: 588761
Changes: 
 netcfg (1.55) unstable; urgency=low
 .
   [ Jeremie Koenig ]
   * More fixes for Hurd support, including network device detection
     (closes: 588761).
 .
   [ Aurelien Jarno ]
   * dhcp: ask udhcpc for dns and not namesrv.
Checksums-Sha1: 
 dc1543b9b3aa766ab2eca65476fbc0ab161a1c4a 1029 netcfg_1.55.dsc
 da057e26b112200e42f2b049f45b45ce2643a168 392466 netcfg_1.55.tar.gz
 b6dd992d0fc6096e6543118f01efffeeb9013b41 300922 netcfg_1.55_amd64.udeb
 c2cc6a7148f4af5526b99566f132fb8e6e5ae0d3 232360 netcfg-static_1.55_amd64.udeb
Checksums-Sha256: 
 af858c586579c7b29d914aff04d83415706ea1d17219bcc53f372e2554e861cd 1029 netcfg_1.55.dsc
 ff51593a0f52159996c82055b83fbe63f7148d21810c2df63e9f29235a12411c 392466 netcfg_1.55.tar.gz
 f3100eab5e899e797115126f7d723c8913668be76dbf84d45f0a45516e7003bc 300922 netcfg_1.55_amd64.udeb
 c14c7a5e3fe4ae1ff041234e01b73386d93c397864c33b50dac65e2588da98fb 232360 netcfg-static_1.55_amd64.udeb
Files: 
 86a8ffe710cbb8eb522c5d2d7fc09706 1029 debian-installer optional netcfg_1.55.dsc
 d6381be8d2ba807913ba737041f8eb76 392466 debian-installer optional netcfg_1.55.tar.gz
 34b3b5d0a0bdcc0e58f48ae817f584e2 300922 debian-installer optional netcfg_1.55_amd64.udeb
 4f77598d4b10e646374d8c278a31681f 232360 debian-installer optional netcfg-static_1.55_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFMXDCzw3ao2vG823MRAgfpAJ43bmWf0HiVHM3Ty/50Icjrtuwd8gCeIKS7
IL8N4ENFXRlXqVSuSfZESso=
=djUU
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: