bug-hurd
[Top][All Lists]
Advanced

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

Re: The patch of boot to open a virtual network interface


From: zhengda
Subject: Re: The patch of boot to open a virtual network interface
Date: Tue, 19 Aug 2008 15:48:11 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080707)

olafBuddenhagen@gmx.net wrote:
Hi,

On Fri, Aug 08, 2008 at 07:06:29AM +0200, zhengda wrote:

But the way to open the virtual network interface will be changed if
the  translator that helps open the device is created.

Indeed... So I guess we better don't commit it just yet :-)

2008-07-29 Zheng Da <zhengda1936@gmail.com>

   *boot/boot.c: add an option to open the virtual network interface

That's not a complete changelog...
Hello,

Here is the new patch for boot. The patch is trying to make boot work with devnode.
I suppose the device file created by devnode should normally be in /dev/.
The boot now accesses devnode only when the request is to open the virtual network interface created by multiplexer.

Zheng Da
Needed for Hurd 0.3

2008-07-29 Zheng Da <zhengda1936@gmail.com>

        * boot/boot.c (ds_device_open): Handle the request to open the virtual 
network device.

diff -u boot.old/boot.c boot/boot.c
--- boot.old/boot.c     2008-08-17 18:38:02.000000000 +0200
+++ boot/boot.c 2008-08-17 18:36:40.520000000 +0200
@@ -964,6 +964,22 @@
       *devicetype = MACH_MSG_TYPE_MAKE_SEND;
       return 0;
     }
+  else if (strncmp (name, "veth", 4) == 0)
+    {
+      char buf[128];
+      mach_port_t net_device;
+
+      snprintf (buf, sizeof(buf), "/dev/%s", name);
+      net_device = file_name_lookup (buf, 0, 0);
+      if (net_device == MACH_PORT_NULL)
+       {
+         error (0, errno, "file_name_lookup");
+         return errno;
+       }
+
+      *devicetype = MACH_MSG_TYPE_MOVE_SEND;
+      return device_open (net_device, mode, "eth", device);
+    }
 
   *devicetype = MACH_MSG_TYPE_MOVE_SEND;
   return device_open (master_device_port, mode, name, device);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]