Skip to content

Commit

Permalink
Fix #90: add support for IPv6 addresses in listen directive
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Aug 27, 2024
1 parent 84b1a93 commit 0fc6656
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/syslogd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3016,8 +3016,26 @@ static void init(void)
static void cflisten(char *ptr, void *arg)
{
char *peer = ptr;
char *p;

while (*peer && isspace(*peer))
++peer;

logit("cflisten[%s]\n", peer);

p = peer;
if (*p == '[') {
p++;

p = strchr(p, ']');
if (!p) {
ERR("Invalid IPv6 address in listen '%s', missing ']'", peer);
return;
}
*p++ = 0;
}

ptr = strchr(peer, ':');
ptr = strchr(p, ':');
if (ptr)
*ptr++ = 0;
addpeer(&(struct peer) {
Expand Down

0 comments on commit 0fc6656

Please sign in to comment.