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

Bug#403706: allow-hotplug and udev



On Tuesday 19 December 2006 23:00, Joey Hess wrote:
> Here's a patch to netcfg, to do that:

I'd prefer to apply the patch below instead. Although it has two lines to
print an "auto <iface>" line, I feel that that is more in line with the
fact that it is a (hopefully temporary) workaround.
I also feel we should document inside the file why this weird configuration
is necessary.

Index: dhcp.c
===================================================================
--- dhcp.c      (revision 43836)
+++ dhcp.c      (working copy)
@@ -37,8 +37,15 @@
         fprintf(fp, "\n# The primary network interface\n");
         if (!iface_is_hotpluggable(iface) && !find_in_stab(iface))
             fprintf(fp, "auto %s\n", iface);
-        else
+        else {
+            fprintf(fp, "# Because to potential problems bringing up hotpluggable interfaces\n");
+            fprintf(fp, "# both an 'auto' and 'allow-hotplug' are used.\n");
+            fprintf(fp, "# See bugs #403706 and #403805 for further information.\n");
+            fprintf(fp, "# If %s is an interface that does not really need hotplugging, you\n", iface);
+            fprintf(fp, "# can safely remove the allow-hotplug line and these comments.\n");
+            fprintf(fp, "auto %s\n", iface);
             fprintf(fp, "allow-hotplug %s\n", iface);
+        }
         fprintf(fp, "iface %s inet dhcp\n", iface);
         if (dhostname) {
             fprintf(fp, "\thostname %s\n", dhostname);
Index: static.c
===================================================================
--- static.c    (revision 43836)
+++ static.c    (working copy)
@@ -180,8 +180,15 @@
         fprintf(fp, "\n# The primary network interface\n");
         if (!iface_is_hotpluggable(interface) && !find_in_stab(interface))
             fprintf(fp, "auto %s\n", interface);
-        else
-            fprintf(fp, "allow-hotplug %s\n", interface);
+        else {
+            fprintf(fp, "# Because to potential problems bringing up hotpluggable interfaces\n");
+            fprintf(fp, "# both an 'auto' and 'allow-hotplug' are used.\n");
+            fprintf(fp, "# See bugs #403706 and #403805 for further information.\n");
+            fprintf(fp, "# If %s is an interface that does not really need hotplugging, you\n", iface);
+            fprintf(fp, "# can safely remove the allow-hotplug line and these comments.\n");
+            fprintf(fp, "auto %s\n", iface);
+            fprintf(fp, "allow-hotplug %s\n", iface);
+        }
         fprintf(fp, "iface %s inet static\n", interface);
         fprintf(fp, "\taddress %s\n", inet_ntop (AF_INET, &ipaddress, ptr1, sizeof (ptr1)));
         fprintf(fp, "\tnetmask %s\n", inet_ntop (AF_INET, &netmask, ptr1, sizeof (ptr1)));

Attachment: pgpwQDlflC9MS.pgp
Description: PGP signature


Reply to: