summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-03-20 16:52:58 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-03-20 16:52:58 +0100
commitcacb817fa3f6b78bad9e13f56d0fa1ed7d0366c1 (patch)
tree1d242f4ad783a0b809ba442f0fc32a316818621d
parent2ee2cff538edd5e2b70a03fcef76e25b2072e432 (diff)
parentc6714bc496a2aaf356d8625784f10168d33859a3 (diff)
downloadrsyslog-cacb817fa3f6b78bad9e13f56d0fa1ed7d0366c1.tar.gz
rsyslog-cacb817fa3f6b78bad9e13f56d0fa1ed7d0366c1.tar.xz
rsyslog-cacb817fa3f6b78bad9e13f56d0fa1ed7d0366c1.zip
Merge branch 'v5-stable-newstats' into v5-devel
Conflicts: ChangeLog plugins/imptcp/imptcp.c
-rw-r--r--ChangeLog4
-rw-r--r--doc/imptcp.html6
-rw-r--r--plugins/imptcp/imptcp.c15
3 files changed, 23 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 49a910e0..5f00e6f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@ Version 5.9.6 [V5-DEVEL], 2012-03-??
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313
- added configuration directive to disable octet-counted framing
for imtcp, directive is $InputTCPServerSupportOctetCountedFraming
+ for imptcp, directive is $InputPTCPServerSupportOctetCountedFraming
+- added capability to use a local interface IP address as fromhost-ip for
+ imuxsock imklog
+ new config directives: $IMUXSockLocalIPIF, $klogLocalIPIF
- added configuration directives to customize queue light delay marks
---------------------------------------------------------------------------
Version 5.9.5 [V5-DEVEL], 2012-01-27
diff --git a/doc/imptcp.html b/doc/imptcp.html
index 386e691a..065efae6 100644
--- a/doc/imptcp.html
+++ b/doc/imptcp.html
@@ -43,6 +43,12 @@ very limited interest in fixing this issue. This directive <b>can not</b> fix th
That would require much more code changes, which I was unable to do so far. Full details
can be found at the <a href="http://www.rsyslog.com/Article321.phtml">Cisco tcp syslog anomaly</a>
page.
+<li><b>$InputPTCPSupportOctetCountedFraming</b> &lt;<b>on</b>|off&gt;<br>
+If set to "on", the legacy octed-counted framing (similar to RFC5425 framing) is
+activated. This is the default and should be left unchanged until you know
+very well what you do. It may be useful to turn it off, if you know this framing
+is not used and some senders emit multi-line messages into the message stream.
+</li>
<li>$InputPTCPServerNotifyOnConnectionClose [on/<b>off</b>]<br>
instructs imptcp to emit a message if the remote peer closes a connection.<br>
<li><b>$InputPTCPServerKeepAlive</b> &lt;on/<b>off</b>&gt;<br>
diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c
index 8333c69d..b5dcf0e7 100644
--- a/plugins/imptcp/imptcp.c
+++ b/plugins/imptcp/imptcp.c
@@ -94,6 +94,7 @@ typedef struct configSettings_s {
int iKeepAliveProbes;
int iKeepAliveTime;
int bEmitMsgOnClose; /* emit an informational message on close by remote peer */
+ int bSuppOctetFram; /* support octet-counted framing? */
int iAddtlFrameDelim; /* addtl frame delimiter, e.g. for netscreen, default none */
uchar *pszInputName; /* value for inputname property, NULL is OK and handled by core engine */
uchar *lstnIP; /* which IP we should listen on? */
@@ -127,6 +128,7 @@ struct ptcpsrv_s {
ptcpsess_t *pSess; /* root of our sessions */
sbool bKeepAlive; /* support keep-alive packets */
sbool bEmitMsgOnClose;
+ sbool bSuppOctetFram;
};
/* the ptcp session object. Describes a single active session.
@@ -141,6 +143,7 @@ struct ptcpsess_s {
//--- from tcps_sess.h
int iMsg; /* index of next char to store in msg */
int bAtStrtOfFram; /* are we at the very beginning of a new frame? */
+ sbool bSuppOctetFram; /**< copy from listener, to speed up access */
enum {
eAtStrtFram,
eInOctetCnt,
@@ -161,6 +164,7 @@ struct ptcplstn_s {
ptcpsrv_t *pSrv; /* our server */
ptcplstn_t *prev, *next;
int sock;
+ sbool bSuppOctetFram;
epolld_t *epd;
statsobj_t *stats; /* listener stats */
STATSCOUNTER_DEF(ctrSubmit, mutCtrSubmit)
@@ -632,7 +636,7 @@ processDataRcvd(ptcpsess_t *pThis, char c, struct syslogTime *stTime, time_t ttG
DEFiRet;
if(pThis->inputState == eAtStrtFram) {
- if(isdigit((int) c)) {
+ if(pThis->bSuppOctetFram && isdigit((int) c)) {
pThis->inputState = eInOctetCnt;
pThis->iOctetsRemain = 0;
pThis->eFraming = TCP_FRAMING_OCTET_COUNTING;
@@ -771,6 +775,7 @@ static inline void
initConfigSettings(void)
{
cs.bEmitMsgOnClose = 0;
+ cs.bSuppOctetFram = 1;
cs.iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER;
cs.pszInputName = NULL;
cs.pRuleset = NULL;
@@ -786,7 +791,7 @@ addEPollSock(epolld_type_t typ, void *ptr, int sock, epolld_t **pEpd)
DEFiRet;
epolld_t *epd = NULL;
- CHKmalloc(epd = malloc(sizeof(epolld_t)));
+ CHKmalloc(epd = calloc(sizeof(epolld_t), 1));
epd->typ = typ;
epd->ptr = ptr;
*pEpd = epd;
@@ -848,6 +853,7 @@ addLstn(ptcpsrv_t *pSrv, int sock, int isIPv6)
CHKmalloc(pLstn = malloc(sizeof(ptcplstn_t)));
pLstn->pSrv = pSrv;
+ pLstn->bSuppOctetFram = pSrv->bSuppOctetFram;
pLstn->sock = sock;
/* support statistics gathering */
CHKiRet(statsobj.Construct(&(pLstn->stats)));
@@ -888,6 +894,7 @@ addSess(ptcplstn_t *pLstn, int sock, prop_t *peerName, prop_t *peerIP)
CHKmalloc(pSess->pMsg = malloc(iMaxLine * sizeof(uchar)));
pSess->pLstn = pLstn;
pSess->sock = sock;
+ pSess->bSuppOctetFram = pLstn->bSuppOctetFram;
pSess->inputState = eAtStrtFram;
pSess->iMsg = 0;
pSess->bAtStrtOfFram = 1;
@@ -992,6 +999,7 @@ static rsRetVal addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVa
pSrv->iKeepAliveIntvl = cs.iKeepAliveTime;
pSrv->iKeepAliveProbes = cs.iKeepAliveProbes;
pSrv->iKeepAliveTime = cs.iKeepAliveTime;
+ pSrv->bSuppOctetFram = cs.bSuppOctetFram;
pSrv->bEmitMsgOnClose = cs.bEmitMsgOnClose;
pSrv->port = pNewVal;
pSrv->iAddtlFrameDelim = cs.iAddtlFrameDelim;
@@ -1261,6 +1269,7 @@ resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unus
cs.iKeepAliveProbes = 0;
cs.iKeepAliveTime = 0;
cs.iKeepAliveIntvl = 0;
+ cs.bSuppOctetFram = 1;
cs.iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER;
free(cs.pszInputName);
cs.pszInputName = NULL;
@@ -1302,6 +1311,8 @@ CODEmodInit_QueryRegCFSLineHdlr
NULL, &cs.iKeepAliveTime, STD_LOADABLE_MODULE_ID));
CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserverkeepalive_intvl"), 0, eCmdHdlrInt,
NULL, &cs.iKeepAliveIntvl, STD_LOADABLE_MODULE_ID));
+ CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserversupportoctetcountedframing"), 0, eCmdHdlrBinary,
+ NULL, &cs.bSuppOctetFram, STD_LOADABLE_MODULE_ID));
CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpservernotifyonconnectionclose"), 0,
eCmdHdlrBinary, NULL, &cs.bEmitMsgOnClose, STD_LOADABLE_MODULE_ID));
CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserveraddtlframedelimiter"), 0, eCmdHdlrInt,