Needed for Hurd 0.3

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

	* ethernet.c (machdev_change_flags): New function.

	* iioctl-ops.c (S_iioctl_siocsifflags): Change the flags of the Mach device.

diff -urN -x '*.[od]' -x '*Server.c' -x '*_S.h' -x '*.prof_d' -x '*~' pfinet2/ethernet.c pfinet/ethernet.c
--- pfinet2/ethernet.c	2008-08-16 18:19:20.000000000 +0200
+++ pfinet/ethernet.c	2008-08-17 17:03:41.000000000 +0200
@@ -329,3 +329,14 @@
 
 #endif /* not HAVE_PCAP */
 
+int machdev_change_flags (struct device *dev, short flags)
+{
+#ifndef NET_FLAGS
+#define NET_FLAGS (('n'<<16) + 4)
+#endif
+  /* Change the  Mach device flags. Some  flags (e.g., promiscuous
+     and multicast) are handled by the drivers. */
+  return device_set_status(((struct ether_device *)dev->priv)->ether_port, 
+                    NET_FLAGS, (dev_status_t) &flags, sizeof (flags));
+}
+
diff -urN -x '*.[od]' -x '*Server.c' -x '*_S.h' -x '*.prof_d' -x '*~' pfinet2/iioctl-ops.c pfinet/iioctl-ops.c
--- pfinet2/iioctl-ops.c	2008-08-11 05:50:34.000000000 +0200
+++ pfinet/iioctl-ops.c	2008-08-15 16:24:32.000000000 +0200
@@ -188,7 +188,11 @@
   else if (!dev)
     err = ENODEV;
   else
-    err = dev_change_flags(dev, flags);
+    {
+      err = dev_change_flags(dev, flags);
+      if (!err)
+        err = machdev_change_flags (dev, flags);
+    }
 
   __mutex_unlock (&global_lock);
   end_using_socket_port (user);
