diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-17 09:40:41 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-17 09:40:41 +0200 |
commit | e16a207726dce038835cdc12a928a95b5b915440 (patch) | |
tree | fd60b04c96128c684f3b6e4af08542029e44091e /runtime | |
parent | 8c65706d22cb62d724a030b5f0a9603751daac2d (diff) | |
download | rsyslog-e16a207726dce038835cdc12a928a95b5b915440.tar.gz rsyslog-e16a207726dce038835cdc12a928a95b5b915440.tar.bz2 rsyslog-e16a207726dce038835cdc12a928a95b5b915440.zip |
moved "bDropMalPTRMsgs" variable to global data pool
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/glbl.h | 2 | ||||
-rw-r--r-- | runtime/net.c | 2 | ||||
-rw-r--r-- | runtime/obj-types.h | 10 |
3 files changed, 13 insertions, 1 deletions
diff --git a/runtime/glbl.h b/runtime/glbl.h index dfde902f..c309fec4 100644 --- a/runtime/glbl.h +++ b/runtime/glbl.h @@ -49,6 +49,8 @@ BEGINinterface(glbl) /* name must also be changed in ENDinterface macro! */ uchar* (*GetWorkDir)(void); int (*GetDefPFFamily)(void); rsRetVal (*SetDefPFFamily)(int); + int (*GetDropMalPTRMsgs)(void); + rsRetVal (*SetDropMalPTRMsgs)(int); ENDinterface(glbl) #define glblCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ diff --git a/runtime/net.c b/runtime/net.c index 6d67693f..b61e4c15 100644 --- a/runtime/net.c +++ b/runtime/net.c @@ -685,7 +685,7 @@ gethname(struct sockaddr_storage *f, uchar *pszHostFQDN) * time being, we simply drop the name we obtained and use the IP - that one * is OK in any way. We do also log the error message. rgerhards, 2007-07-16 */ - if(bDropMalPTRMsgs == 1) { + if(glbl.GetDropMalPTRMsgs() == 1) { snprintf((char*)szErrMsg, sizeof(szErrMsg) / sizeof(uchar), "Malicious PTR record, message dropped " "IP = \"%s\" HOST = \"%s\"", diff --git a/runtime/obj-types.h b/runtime/obj-types.h index 32589646..e245b633 100644 --- a/runtime/obj-types.h +++ b/runtime/obj-types.h @@ -114,6 +114,16 @@ typedef struct obj { /* the dummy struct that each derived class can be casted t # define ISOBJ_assert(pObj) #endif +/* a set method for *very simple* object accesses. Note that this does + * NOT conform to the standard calling conventions and should be + * used only if actually nothing can go wrong! -- rgerhards, 2008-04-17 + */ +#define DEFpropGetMeth(obj, prop, dataType)\ + dataType obj##Get##prop(void)\ + { \ + return pThis->prop = pVal; \ + } + #define DEFpropSetMethPTR(obj, prop, dataType)\ rsRetVal obj##Set##prop(obj##_t *pThis, dataType *pVal)\ { \ |