From 593970e0ba23c460a12a5cb403dd31fbfa79857c Mon Sep 17 00:00:00 2001 From: Tomasz Kojm Date: Tue, 10 Nov 2009 16:51:51 +0100 Subject: [PATCH] freshclam/notify.c: fix clamd notification in TCP mode (bb#1756) --- ChangeLog | 4 ++++ freshclam/notify.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 58ae2cf22..c7f64c622 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Nov 10 16:50:56 CET 2009 (tk) +--------------------------------- + * freshclam/notify.c: fix clamd notification in TCP mode (bb#1756) + Tue Nov 10 12:52:43 CET 2009 (acab) ----------------------------------- * doc/man/clamav-milter.8.in: fix typo diff --git a/freshclam/notify.c b/freshclam/notify.c index 8dfb0054e..9408e40df 100644 --- a/freshclam/notify.c +++ b/freshclam/notify.c @@ -100,8 +100,9 @@ int notify(const char *cfgfile) #else hints.ai_family = AF_INET; #endif + hints.ai_flags = AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; - snprintf(port, 5, "%u", (unsigned int) opt->numarg); + snprintf(port, sizeof(port), "%u", (unsigned int) opt->numarg); port[5] = 0; if((opt = optget(opts, "TCPAddr"))->enabled)