From: Antti Kantee Date: Mon, 26 Oct 2015 15:02:48 +0000 (+0000) Subject: Turn duplicate address detection off. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=62643676836a0be5f388d4e5a3bb791372b28c88;p=osstest%2Frumprun.git Turn duplicate address detection off. 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. --- diff --git a/lib/librumprun_base/rumprun.c b/lib/librumprun_base/rumprun.c index 7635028..1cdce3d 100644 --- a/lib/librumprun_base/rumprun.c +++ b/lib/librumprun_base/rumprun.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -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");