summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-09-18 15:04:30 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-09-18 15:04:30 -0400
commit78726453ea2dfc6f34c99a660c543df659b62a58 (patch)
treedcc992eef1a18b01059b515fbab46d738ccfa6d3 /gpsd.c
parentade8609bc24f4220220ca75f4e5d5010bd8a7f3f (diff)
downloadgpsd-78726453ea2dfc6f34c99a660c543df659b62a58.tar.gz
Revert "Try once again to make -G work with IPV6."
That change led to a spurious message about the listen address already being in use.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gpsd.c b/gpsd.c
index ea8bfeec..ee2156ca 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -402,10 +402,17 @@ static int passivesock_af(int af, char *service, char *tcp_or_udp, int qlen)
sat.sa_in6.sin6_family = (sa_family_t) AF_INET6;
#ifndef FORCE_GLOBAL_ENABLE
if (!listen_global)
- sat.sa_in6.sin6_addr = in6addr_loopback;
- else
+ sat.sa_in6.sin6_addr = in6addr_loopback;
#endif /* FORCE_GLOBAL_ENABLE */
- sat.sa_in6.sin6_addr = in6addr_any;
+ /* else */
+ /* BAD: sat.sa_in6.sin6_addr = in6addr_any;
+ * the simple assignment will not work (except as an initializer)
+ * because sin6_addr is an array not a simple type
+ * we could do something like this:
+ * memcpy(sat.sa_in6.sin6_addr, in6addr_any, sizeof(sin6_addr));
+ * BUT, all zeros is IPv6 wildcard, and we just zeroed the array
+ * so really nothing to do here
+ */
sat.sa_in6.sin6_port = htons(port);
/*