Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c
From: Heinz Junkes <junkes@fhi-berlin.mpg.de>
To: core-talk@aps.anl.gov
Date: Thu, 20 Apr 2017 13:27:29 +0200
With RTEMS (4.11.99, aka 4.12) setting the IP_MULTICAST_LOOP for the loopback gives

rsrv: failed to set mcast loopback

Had to use sizeof char as argument for the IP_MULTICAST_LOOP setsockopt call.
Changed it to 

…
        int intTrue = 1;
        if (setsockopt (beaconSocket, SOL_SOCKET, SO_BROADCAST,
                        (char *)&intTrue, sizeof(intTrue))<0) {
            cantProceed("CAS: online socket set up error\n");
        }
#ifdef IP_ADD_MEMBERSHIP
        {
#if defined(__rtems__)
            char flag = 1;
#else
            int flag = 1;
#endif
            if (setsockopt(beaconSocket, IPPROTO_IP, IP_MULTICAST_LOOP,
                           (char *)&flag, sizeof(flag))<0) {
                char sockErrBuf[64];
                epicsSocketConvertErrnoToString (
                            sockErrBuf, sizeof ( sockErrBuf ) );
                errlogPrintf("rsrv: failed to set mcast loopback (%d:%s)\n", errno, sockErrBuf);
            }
        }
#endif
    }

    /* populate the interface address list (default is empty) */
    {
…



rtems@epics:~/EPICS/add-rtems-4.12-api$ diff -Naur src/ioc/rsrv/caservertask.c /tmp/caservertask.c
--- src/ioc/rsrv/caservertask.c	2017-04-20 13:21:40.613544330 +0200
+++ /tmp/caservertask.c	2017-04-20 13:23:06.537549469 +0200
@@ -307,17 +307,13 @@
         }
 #ifdef IP_ADD_MEMBERSHIP
         {
-#if defined(__rtems__)
-	    char flag = 1;
-#else
             int flag = 1;
-#endif
             if (setsockopt(beaconSocket, IPPROTO_IP, IP_MULTICAST_LOOP,
                            (char *)&flag, sizeof(flag))<0) {
                 char sockErrBuf[64];
                 epicsSocketConvertErrnoToString (
                             sockErrBuf, sizeof ( sockErrBuf ) );
-                errlogPrintf("rsrv: failed to set mcast loopback (%d:%s)\n", errno, sockErrBuf);
+                errlogPrintf("rsrv: failed to set mcast loopback\n");
             }
         }
 #endif

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Replies:
Re: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Heinz Junkes

Navigate by Date:
Prev: Build failed in Jenkins: epics-base-3.15-win32s-test #103 APS Jenkins
Next: Re: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Heinz Junkes
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Jenkins build is back to normal : epics-base-3.15-win64 #289 APS Jenkins
Next: Re: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Heinz Junkes
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 20 Apr 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·