From bba6dc1d5b0e724b357da4b3829835bc9df3b337 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Mon, 18 Sep 2006 03:50:30 +0000 Subject: [PATCH] Listen to a control socket on an IPv4 as well through an IPv4-mapped IPv6 address. Reported by: Julian H. Stacey Test by: Julian H. Stacey MFC after: 1 week --- usr.sbin/ppp/server.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c index 5be1357d17e5..864c62742aa9 100644 --- a/usr.sbin/ppp/server.c +++ b/usr.sbin/ppp/server.c @@ -346,6 +346,13 @@ server_TcpOpen(struct bundle *bundle, u_short port) goto failed; } +#ifndef NOINET6 + if (probe.ipv6_available) { + int off = 0; + setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&off, sizeof(off)); + } +#endif + setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &s, sizeof s); if (bind(s, (struct sockaddr *)&ss, sz) < 0) { log_Printf(LogWARN, "Tcp: bind: %s\n", strerror(errno));