]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Give useful warning when both IPv4 and IPv6 are disabled on a socksport
authorNick Mathewson <nickm@torproject.org>
Fri, 16 Nov 2012 03:58:54 +0000 (22:58 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 16 Nov 2012 03:58:54 +0000 (22:58 -0500)
src/or/config.c

index f7a803fd2835705fc707bc506789a0f38fcc3114..206ccc80d5bd7cd120537feb74c3d8296d90fc0a 100644 (file)
@@ -4777,6 +4777,12 @@ parse_port_config(smartlist_t *out,
     else
       got_zero_port = 1;
 
+    if (ipv4_traffic == 0 && ipv6_traffic == 0) {
+      log_warn(LD_CONFIG, "You have a %sPort entry with both IPv4 and "
+               "IPv6 disabled; that won't work.", portname);
+      goto err;
+    }
+
     if (out && port) {
       port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t));
       tor_addr_copy(&cfg->addr, &addr);