summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-09-27 14:52:22 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-09-27 14:52:22 +0000
commitfeb10f47b7c4f76a646784455a32866dbb82d210 (patch)
tree47ac424eaa86fc7ec0c50e62aac428babf0af905 /syslogd.c
parent59c47ee112b475d58843b6c883bd7a549759da14 (diff)
downloadrsyslog-feb10f47b7c4f76a646784455a32866dbb82d210.tar.gz
rsyslog-feb10f47b7c4f76a646784455a32866dbb82d210.tar.xz
rsyslog-feb10f47b7c4f76a646784455a32866dbb82d210.zip
updated sample config; better error reporting on allowedSenders
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c13
1 files changed, 13 insertions, 0 deletions
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;