summaryrefslogtreecommitdiffstats
path: root/tcpsrv.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-11-29 09:47:04 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2008-11-29 09:47:04 +0100
commit97b89435aad77bd6d9e18747b55d701e360d5aac (patch)
treeb2ed4f1de99fe0a69ec96e37624a5750d3cd504e /tcpsrv.c
parent48799529955eff8eb3120b02a356a92a8bd9b2ae (diff)
downloadrsyslog-97b89435aad77bd6d9e18747b55d701e360d5aac.tar.gz
rsyslog-97b89435aad77bd6d9e18747b55d701e360d5aac.tar.xz
rsyslog-97b89435aad77bd6d9e18747b55d701e360d5aac.zip
bugfix: $AllowedSender handled invalidly for plain TCP transport
Diffstat (limited to 'tcpsrv.c')
-rw-r--r--tcpsrv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tcpsrv.c b/tcpsrv.c
index 8aeb9f5c..1f307b7e 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -312,7 +312,7 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm)
tcps_sess_t *pSess;
netstrm_t *pNewStrm = NULL;
int iSess = -1;
- struct sockaddr_storage addr;
+ struct sockaddr_storage *addr;
uchar *fromHostFQDN = NULL;
uchar *fromHostIP = NULL;
@@ -336,13 +336,14 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm)
/* get the host name */
CHKiRet(netstrm.GetRemoteHName(pNewStrm, &fromHostFQDN));
CHKiRet(netstrm.GetRemoteIP(pNewStrm, &fromHostIP));
+ CHKiRet(netstrm.GetRemAddr(pNewStrm, &addr));
/* TODO: check if we need to strip the domain name here -- rgerhards, 2008-04-24 */
/* Here we check if a host is permitted to send us messages. If it isn't, we do not further
* process the message but log a warning (if we are configured to do this).
* rgerhards, 2005-09-26
*/
- if(!pThis->pIsPermittedHost((struct sockaddr*) &addr, (char*) fromHostFQDN, pThis->pUsr, pSess->pUsr)) {
+ if(!pThis->pIsPermittedHost((struct sockaddr*) addr, (char*) fromHostFQDN, pThis->pUsr, pSess->pUsr)) {
dbgprintf("%s is not an allowed sender\n", fromHostFQDN);
if(glbl.GetOption_DisallowWarning()) {
errno = 0;