]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
Turn duplicate address detection off.
authorAntti Kantee <pooka@iki.fi>
Mon, 26 Oct 2015 15:02:48 +0000 (15:02 +0000)
committerAntti Kantee <pooka@iki.fi>
Mon, 26 Oct 2015 15:06:33 +0000 (15:06 +0000)
Otherwise the network is unavailable for several seconds
after boot.  There's really no good solution here, but this
one is probably the best, i.e. hoping that things don't go wrong.

nb. turning DAD off cannot be implemented properly with our
current src-netbsd because the dad_count sysctl node is missing.
The current hack will prevent from linking a non-kernonly image
without networking, but I don't think anyone is using that
currently anyway.  To be fixed properly after I next update
src-netbsd.

Fixes issue #56.

lib/librumprun_base/rumprun.c

index 7635028af2ceda970e21d924509250a546f8821e..1cdce3db201f93913b247d26c09b295dee8d7213 100644 (file)
@@ -28,6 +28,7 @@
 #include <sys/types.h>
 #include <sys/mount.h>
 #include <sys/queue.h>
+#include <sys/sysctl.h>
 
 #include <assert.h>
 #include <err.h>
@@ -114,6 +115,22 @@ rumprun_boot(char *cmdline)
                warnx("FAILED: mount tmpfs on /tmp: %s", strerror(tmpfserrno));
        }
 
+       /*
+        * We set duplicate address detection off for
+        * immediately operational DHCP addresses.
+        * (note: we don't check for errors since net.inet.ip.dad_count
+        * is not present if the networking stack isn't present)
+        */
+#if 0
+       /* XXXX: cpp macro lossage in the src-netbsd, cannot fix easily now */
+       int x = 0;
+       sysctlbyname("net.inet.ip.dad_count", NULL, NULL, &x, sizeof(x));
+#else
+       extern int rumpns_ip_dad_count;
+       rumpns_ip_dad_count = 0;
+#endif
+
+
        rumprun_config(cmdline);
 
        sysproxy = getenv("RUMPRUN_SYSPROXY");