summaryrefslogtreecommitdiffstats
path: root/runtime/net.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-12-08 15:42:47 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2008-12-08 15:42:47 +0100
commit60b8ce14bf33e76237cf82dd1f68acc750e64316 (patch)
treed237ae8806139dfdfcd466b99d67244bc84a509c /runtime/net.c
parent128edc1598a13c894fe3853673d1231b9feafc39 (diff)
downloadrsyslog-60b8ce14bf33e76237cf82dd1f68acc750e64316.tar.gz
rsyslog-60b8ce14bf33e76237cf82dd1f68acc750e64316.tar.xz
rsyslog-60b8ce14bf33e76237cf82dd1f68acc750e64316.zip
added $PreserveFQDN config file directive
Enables to use FQDNs in sender names where the legacy default
Diffstat (limited to 'runtime/net.c')
-rw-r--r--runtime/net.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/net.c b/runtime/net.c
index 1472b4db..30c923fe 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -1204,7 +1204,9 @@ rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN
* make this in option in the long term. (rgerhards, 2007-09-11)
*/
strcpy((char*)pszHost, (char*)pszHostFQDN);
- if ((p = (uchar*) strchr((char*)pszHost, '.'))) { /* find start of domain name "machine.example.com" */
+ if( (glbl.GetPreserveFQDN() == 0)
+ && (p = (uchar*) strchr((char*)pszHost, '.'))) { /* find start of domain name "machine.example.com" */
+ strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain()));
if(strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain()) == 0) {
*p = '\0'; /* simply terminate the string */
} else {