From f513681bc07a5df340ebf01d02292d3290623793 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 7 Mar 1995 22:56:45 +0000 Subject: [PATCH] no zero length message under SOLARIS --- src/ca/iocinf.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ca/iocinf.c b/src/ca/iocinf.c index d4417ef78..6e2e08992 100644 --- a/src/ca/iocinf.c +++ b/src/ca/iocinf.c @@ -567,21 +567,34 @@ void notify_ca_repeater() LOCK; /*MULTINET TCP/IP routines are not reentrant*/ status = local_addr(piiuCast->sock_chan, &saddr); if (status == OK) { + int len; + memset((char *)&msg, 0, sizeof(msg)); msg.m_cmmd = htons(REPEATER_REGISTER); msg.m_available = saddr.sin_addr.s_addr; saddr.sin_port = htons(ca_static->ca_repeater_port); + /* * Intentionally sending a zero length message here * until most CA repeater daemons have been restarted * (and only then will accept the above protocol) * (repeaters began accepting this protocol * starting with EPICS 3.12) + * + * SOLARIS will not accept a zero length message + * and we are just porting there for 3.12 so + * we will use the new protocol for 3.12 */ +# ifdef SOLARIS + len = sizeof(msg); +# else /* SOLARIS */ + len = 0; +# endif /* SOLARIS */ + status = sendto( piiuCast->sock_chan, (char *)&msg, /* UCX requires a valid address here */ - 0, /* <= sizeof(msg) ! see comment above ! */ + len, 0, (struct sockaddr *)&saddr, sizeof(saddr));