rsrv: reject a non-finite beacon period

The beacon-period gate in online_notify already rejected a parse
failure and a non-positive value, but epicsScanDouble parses "nan" and
"inf", and maxPeriod<=0.0 is false for both, so a non-finite period
reached the beacon delay loop. A NaN maxdelay makes delay<maxdelay
false forever, pinning the beacon interval at the 0.02 s startup value
- a ~50 Hz beacon flood on every configured interface; an infinite
maxdelay lets the doubling delay grow without bound, silencing beacons
entirely.

Gate on finite() (from epicsMath.h), matching the client-side
EPICS_CA_MAX_SEARCH_PERIOD handling in udpiiu.cpp, and name the actual
problem in the diagnostic instead of "float fetch failed" (the message
already covered the non-positive case, which is not a fetch failure).
This commit is contained in:
Sang Woo Kim authored and Dirk Zimoch committed 2026-10-14 11:21:36 +02:00
1 parent f373f04396
commit 5a225a9bbb
1 file changed
+3 -2
@@ -27,6 +27,7 @@
#include "addrList.h"
#include "dbDefs.h"
#include "envDefs.h"
#include "epicsMath.h"
#include "errlog.h"
#include "osiSock.h"
#include "taskwd.h"
@@ -55,9 +56,9 @@ void rsrv_online_notify_task(void *pParm)
else {
longStatus = envGetDoubleConfigParam ( & EPICS_CA_BEACON_PERIOD, & maxPeriod );
}
if (longStatus || maxPeriod<=0.0) {
if (longStatus || !finite(maxPeriod) || maxPeriod<=0.0) {
maxPeriod = 15.0;
epicsPrintf ("EPICS \"%s\" float fetch failed\n",
epicsPrintf ("EPICS \"%s\" was not a positive real number\n",
EPICS_CAS_BEACON_PERIOD.name);
epicsPrintf ("Setting \"%s\" = %f\n",
EPICS_CAS_BEACON_PERIOD.name, maxPeriod);