summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-16 13:11:06 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-16 13:11:06 +0000
commit7822caa94ad3b03f192bdad298b57f1bb2c50b4e (patch)
tree234fc681073152000f0f2b06e121ed5172b30bc2 /parse.c
parenta8c6819d7e1cc570a0c2c633d6b6bfa635685d23 (diff)
downloadrsyslog-7822caa94ad3b03f192bdad298b57f1bb2c50b4e.tar.gz
rsyslog-7822caa94ad3b03f192bdad298b57f1bb2c50b4e.tar.xz
rsyslog-7822caa94ad3b03f192bdad298b57f1bb2c50b4e.zip
fully integrated patch from mildew@gmail.com
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 8bdb206b..900c4ef3 100644
--- a/parse.c
+++ b/parse.c
@@ -358,11 +358,12 @@ rsRetVal parsQuotedCStr(rsParsObj *pThis, rsCStrObj **ppCStr)
* full hostname (e.g.: localhost.localdomain) or hostname wildcard
* (e.g.: *.localdomain).
*/
+#ifdef SYSLOG_INET
rsRetVal parsAddrWithBits(rsParsObj *pThis, struct NetAddr **pIP, int *pBits)
{
register unsigned char *pC;
unsigned char *pszIP;
- char *pszTmp;
+ uchar *pszTmp;
struct addrinfo hints, *res = NULL;
rsCStrObj *pCStr;
rsRetVal iRet;
@@ -447,7 +448,7 @@ rsRetVal parsAddrWithBits(rsParsObj *pThis, struct NetAddr **pIP, int *pBits)
/* no slash, so we assume a single host (/128) */
*pBits = 128;
}
- } else {
+ } else { /* now parse IPv4 */
memset (&hints, 0, sizeof (struct addrinfo));
hints.ai_family = AF_INET;
hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICHOST;
@@ -494,6 +495,8 @@ rsRetVal parsAddrWithBits(rsParsObj *pThis, struct NetAddr **pIP, int *pBits)
return RS_RET_OK;
}
+#endif /* #ifdef SYSLOG_INET */
+
/* tell if the parsepointer is at the end of the
* to-be-parsed string. Returns 1, if so, 0