[Dnsmasq-discuss] multiple dhcp6 servers
Gene Czarcinski
gene at czarc.net
Sat Oct 13 18:49:08 BST 2012
On 10/13/2012 01:20 PM, Gene Czarcinski wrote:
> -----------------------------
> + /* When bind-interfaces is set, there might be more than one dnmsasq
> + instance binding port 547. That's OK if they serve different
> networks.
> + Need to set REUSEADDR to make this posible, or REUSEPORT on
> *BSD. */
> + if (option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND))
> + {
> + int oneopt = 1;
> +#ifdef SO_REUSEPORT
> + int rc = setsockopt(fd, IPPROTO_IPV6, SO_REUSEPORT, &oneopt,
> sizeof(oneopt));
> +#else
> + int rc = setsockopt(fd, IPPROTO_IPV6, SO_REUSEADDR, &oneopt,
> sizeof(oneopt));
> +#endif
> + if (rc == -1)
> + die(_("failed to set SO_REUSE{ADDR|PORT} on DHCP socket: %s"),
> NULL, EC_BADNET);
> + }
> +
> ---------------------------
Arrgh! Well, you can tell that I don't really know what I am doing with
socket code!
Your original code inserted into dhcp6.c was the right thing to do. I
just changed IPPROTO_IPV6 to SOL_SOCKET and it looks like it works (I
have two of them running anyway). At this point I do now know if you
need the V6ONLY or not.
Now to do some real testing!
Gene
More information about the Dnsmasq-discuss
mailing list