[BUG] cfgparse: correctly count one socket per port in ranges
We used to only count one socket instead of one per listener. This makes
the socket count wrong, preventing from automatically computing the proper
number of sockets to bind.
This fix must be backported to 1.4 and 1.3.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index dd266af..c588b46 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1431,8 +1431,8 @@
new->conf.file = file;
new->conf.line = linenum;
new = new->next;
+ global.maxsock++;
}
- global.maxsock++;
}
/* set default values */
@@ -1633,6 +1633,7 @@
new_listen->conf.file = file;
new_listen->conf.line = linenum;
new_listen = new_listen->next;
+ global.maxsock++;
}
/* Set default global rights and owner for unix bind */
@@ -1908,7 +1909,6 @@
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- global.maxsock++;
goto out;
}
else if (!strcmp(args[0], "monitor-net")) { /* set the range of IPs to ignore */