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: Re: 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:42:19 +0200
diff now in the right order, sorry;-)

=== modified file 'src/ioc/rsrv/caservertask.c'
--- src/ioc/rsrv/caservertask.c 2016-05-22 12:38:18 +0000
+++ src/ioc/rsrv/caservertask.c 2017-04-20 11:21:40 +0000
@@ -307,13 +307,17 @@
         }
 #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\n");
+                errlogPrintf("rsrv: failed to set mcast loopback (%d:%s)\n", errno, sockErrBuf);
             }
         }
 #endif




> On 20 Apr 2017, at 13:27, Heinz Junkes <junkes@fhi-berlin.mpg.de> wrote:
> 
> 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 Michael Davidsaver
References:
RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Heinz Junkes

Navigate by Date:
Prev: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Heinz Junkes
Next: Re: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Heinz Junkes
Next: Re: RTEMS: rsrv: failed to set mcast loopback in src/ioc/rsrv/caservertask.c Michael Davidsaver
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 ·