nsd_ptcp fix: misleading error messages (regression from ad1fd21)

We received reports of log messages incorrectly referring to "imptcp" even
though the imptcp module was not loaded on the system. This caused confusion
during troubleshooting.

One such message was:

  rsyslogd: imptcp cannot set keepalive intvl - ignored: Bad file descriptor

This message originated from the nsd_ptcp module, but the LogError() calls
in EnableKeepAlive() still used "imptcp" as the source name.

This is a regression introduced in commit ad1fd21, which restructured
TCP input handling and moved responsibility for keepalive setup to nsd_ptcp,
but did not update the associated log messages.

This patch corrects the affected log strings to use "nsd_ptcp", accurately
reflecting the code path that emits them.

There is no functional change; the patch improves clarity of log output and
prevents misleading diagnostics.

The actual error shown could be related to a different issue,
see also https://github.com/rsyslog/rsyslog/pull/5749
This commit is contained in:
Rainer Gerhards 2025-07-06 16:08:16 +02:00
parent c0391f5a84
commit 3cd89a47e6
No known key found for this signature in database
GPG Key ID: 0CB6B2A8BE80B499

View File

@ -932,7 +932,7 @@ EnableKeepAlive(nsd_t *pNsd)
ret = -1;
# endif
if(ret < 0) {
LogError(ret, NO_ERRCODE, "imptcp cannot set keepalive probes - ignored");
LogError(ret, NO_ERRCODE, "nsd_ptcp cannot set keepalive probes - ignored");
}
# if defined(IPPROTO_TCP) && defined(TCP_KEEPIDLE)
@ -947,7 +947,7 @@ EnableKeepAlive(nsd_t *pNsd)
ret = -1;
# endif
if(ret < 0) {
LogError(ret, NO_ERRCODE, "imptcp cannot set keepalive time - ignored");
LogError(ret, NO_ERRCODE, "nsd_ptcp cannot set keepalive time - ignored");
}
# if defined(IPPROTO_TCP) && defined(TCP_KEEPCNT)
@ -962,7 +962,7 @@ EnableKeepAlive(nsd_t *pNsd)
ret = -1;
# endif
if(ret < 0) {
LogError(errno, NO_ERRCODE, "imptcp cannot set keepalive intvl - ignored");
LogError(errno, NO_ERRCODE, "nsd_ptcp cannot set keepalive intvl - ignored");
}
dbgprintf("KEEPALIVE enabled for socket %d\n", pThis->sock);