From feb10f47b7c4f76a646784455a32866dbb82d210 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 27 Sep 2005 14:52:22 +0000 Subject: updated sample config; better error reporting on allowedSenders --- syslogd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'syslogd.c') diff --git a/syslogd.c b/syslogd.c index 23e0990d..27643bbe 100644 --- a/syslogd.c +++ b/syslogd.c @@ -787,6 +787,19 @@ static rsRetVal AddAllowedSender(struct AllowedSenders **ppRoot, struct AllowedS == NULL) return RS_RET_OUT_OF_MEMORY; /* no options left :( */ + if(iSignificantBits == 0) + /* we handle this seperatly just to provide a better + * error message. + */ + logerror("You can not specify 0 bits of the netmask, this would " + "match ALL systems. If you really intend to do that, " + "remove all $AllowedSender directives."); + if((iSignificantBits < 1) || (iSignificantBits > 32)) { + logerrorInt("Invalid bit number in IP address - adjusted to 32", + iSignificantBits); + iSignificantBits = 32; + } + /* populate entry */ pEntry->bitsToShift = 32 - iSignificantBits; /* IPv4! */ pEntry->allowedSender = iAllow >> pEntry->bitsToShift; -- cgit v1.2.3