diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-12-04 17:43:16 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-12-04 17:43:16 +0100 |
commit | 94cab477f5f308e3e8f24a58c381c1c92377c697 (patch) | |
tree | 07b627ab7ee52e405870bce9262e82efdde99aab /plugins | |
parent | a453c7d858779736621c336bc1973bbaf6d6d87a (diff) | |
parent | afdccceefa30306cf720a27efd5a29bcc5a916c9 (diff) | |
download | rsyslog-94cab477f5f308e3e8f24a58c381c1c92377c697.tar.gz rsyslog-94cab477f5f308e3e8f24a58c381c1c92377c697.tar.xz rsyslog-94cab477f5f308e3e8f24a58c381c1c92377c697.zip |
Merge branch 'v3-stable' into betav3.21.9
Conflicts:
ChangeLog
configure.ac
doc/manual.html
plugins/imudp/imudp.c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/imudp/imudp.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 4b3f9a11..e9e82b20 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -52,6 +52,10 @@ DEFobjCurrIf(glbl) DEFobjCurrIf(net) static int iMaxLine; /* maximum UDP message size supported */ +static time_t ttLastDiscard = 0; /* timestamp when a message from a non-permitted sender was last discarded + * This shall prevent remote DoS when the "discard on disallowed sender" + * message is configured to be logged on occurance of such a case. + */ static int *udpLstnSocks = NULL; /* Internet datagram sockets, first element is nbr of elements * read-only after init(), but beware of restart! */ static uchar *pszBindAddr = NULL; /* IP to bind socket to */ @@ -200,8 +204,15 @@ CODESTARTrunInput } else { dbgprintf("%s is not an allowed sender\n", (char*)fromHostFQDN); if(glbl.GetOption_DisallowWarning) { - errmsg.LogError(0, NO_ERRCODE, "UDP message from disallowed sender %s discarded", - (char*)fromHost); + time_t tt; + + time(&tt); + if(tt > ttLastDiscard + 60) { + ttLastDiscard = tt; + errmsg.LogError(0, NO_ERRCODE, + "UDP message from disallowed sender %s discarded", + (char*)fromHost); + } } } } |