diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-05-16 13:36:41 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-05-16 13:36:41 +0200 |
commit | 09afe64f29bae5af8ea1749373e8c8b6586b70d1 (patch) | |
tree | ffb0034512375ede89f0d3611db0550ad58e65a9 /tcpsrv.c | |
parent | a58ad72051a73b8a26e792507544ad4b41283ca7 (diff) | |
download | rsyslog-09afe64f29bae5af8ea1749373e8c8b6586b70d1.tar.gz rsyslog-09afe64f29bae5af8ea1749373e8c8b6586b70d1.tar.bz2 rsyslog-09afe64f29bae5af8ea1749373e8c8b6586b70d1.zip |
added fromhost-ip properties and some bugfixes
- bugfix: TCP input modules did incorrectly set fromhost property
(always blank)
- bugfix: imklog did not set fromhost property
- added "fromhost-ip" property
- added "RSYSLOG_DebugFormat" canned template
- bugfix: hostname and fromhost were swapped when a persisted message
(in queued mode) was read in
Diffstat (limited to 'tcpsrv.c')
-rw-r--r-- | tcpsrv.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -314,6 +314,7 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm) int iSess = -1; struct sockaddr_storage addr; uchar *fromHostFQDN = NULL; + uchar *fromHostIP = NULL; ISOBJ_TYPE_assert(pThis, tcpsrv); @@ -333,7 +334,8 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm) /* OK, we have a "good" index... */ /* get the host name */ - CHKiRet(netstrm.GetRemoteHName(pStrm, &fromHostFQDN)); + CHKiRet(netstrm.GetRemoteHName(pNewStrm, &fromHostFQDN)); + CHKiRet(netstrm.GetRemoteIP(pNewStrm, &fromHostIP)); /* 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 @@ -353,6 +355,7 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm) * means we can finally fill in the session object. */ CHKiRet(tcps_sess.SetHost(pSess, fromHostFQDN)); + CHKiRet(tcps_sess.SetHostIP(pSess, fromHostIP)); CHKiRet(tcps_sess.SetStrm(pSess, pNewStrm)); pNewStrm = NULL; /* prevent it from being freed in error handler, now done in tcps_sess! */ CHKiRet(tcps_sess.SetMsgIdx(pSess, 0)); |