Files
epics-base/modules/ca/src/client
Torsten Bögershausen a8e8d22c31 iocinf.cpp: Hostnames may be longer than 32 bytes
Found here at ESS:

(all in one line)
EPICS_CA_ADDR_LIST=averylonghostname.mylabnetwork.technicalnetwork.example.com
EPICS_CA_AUTO_ADDR_LIST=NO
caget somePVnam

leads to something like this:
CA.Client.Exception...............................................
    Warning: "Empty PV search address list"
    Source File: ../udpiiu.cpp line 403
    Current Time: Thu Jun 09 2022 10:10:47.804161447

Problem desription:
addAddrToChannelAccessAddressList() will collect what ever we specify in
EPICS_CA_ADDR_LIST for channel access.
That function will add IP-addresses to the search list.
hostnames are possible, but are ignored if longer than 32 bytes,
because buf is too short.

If a hostname can be resolved into an IP, that is fine,
if not that is "fine as well" (better say: silently ignored):
If, and only if, EPICS_CA_AUTO_ADDR_LIST=NO is given then the one
and only too long hostname will be ignored and lead to an
"Empty PV search address list".

If EPICS_CA_AUTO_ADDR_LIST=YES (or nothing) is specified, the search list
is not empty, and EPICS will search all broadcast addresses.
This will eventually lead into a timout.

Solution:
Increase the buf size in addAddrToChannelAccessAddressList() from 32 to 256

The maximum length for a hostname is 255:
https://www.ietf.org/rfc/rfc1034.txt

If we add one byte for the string terminating '\0', we need 256 bytes.

And yes, this patch neglets the fact that a user can specify HOSTNAME:PORT,
which may need another 6 bytes. To put it the other way around:
In this case the hostname length is limited to 250 bytes,
which is still long enough in practice.
2022-09-02 18:28:34 -07:00
..
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2018-06-19 11:33:25 +02:00
2021-08-29 07:27:50 -07:00
2022-01-04 17:16:59 -06:00
2021-08-29 07:27:50 -07:00
2018-06-19 11:33:25 +02:00
2021-10-18 08:45:13 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2018-06-19 11:33:25 +02:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-05-19 09:02:21 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2018-06-19 11:33:25 +02:00
2021-08-29 07:27:50 -07:00
2021-08-29 07:27:50 -07:00
2021-11-13 11:47:15 -08:00
2021-08-29 07:27:50 -07:00
2022-04-16 13:23:58 -07:00
2020-11-18 10:54:44 -08:00