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: binding in pvAccessCPP/src/remote/blockingUDPConnector.cpp (bundleCPP) needs INADDR_ANY in addr for RTEMS 4.12
From: Heinz Junkes <junkes@fhi-berlin.mpg.de>
To: core-talk@aps.anl.gov
Date: Fri, 21 Apr 2017 18:16:02 +0200
Now I got the bundleCPP working with RTEMS 4.11.99 (aka 4.12) and EPICS 3.16 with some changes I will discuss next week.

In the bundleCPP, in pvAccessCPP/src/remote/blockingUDPConnector.cpp

I had to change the sin_addr.s_addr for all interfaces except loopback or multicast prior the binding
to INADDR_ANY.

Otherwise bind runs into an error (Not available or similiar). I made the descision with a stupid compare
 for these two used addresses (127.0.0.1 and 224.0.0.1, a better solution is welcome ;-) ):

if bindAddress.ia.sin_addr.s_addr & 0x00ffff00

rtems@epics:~$ diff -Naru ./FHI/EPICS/V4/ohneGit/EPICS-CPP-4.6.0-rc1/pvAccessCPP/src/remote/blockingUDPConnector.cpp ./EPICS/bundleCPP/pvAccessCPP/src/remote/blockingUDPConnector.cpp
--- ./FHI/EPICS/V4/ohneGit/EPICS-CPP-4.6.0-rc1/pvAccessCPP/src/remote/blockingUDPConnector.cpp 2016-08-30 01:49:35.000000000 +0200
+++ ./EPICS/bundleCPP/pvAccessCPP/src/remote/blockingUDPConnector.cpp 2017-04-20 18:18:21.790608978 +0200
@@ -59,6 +59,11 @@
     if (_reuseSocket)
         epicsSocketEnableAddressUseForDatagramFanout(socket);

+if (bindAddress.ia.sin_addr.s_addr & 0x00ffff00) {
+    LOG(logLevelDebug, "Try to bind to INADDR_ANY 0x%x:%d",
+        bindAddress.ia.sin_addr.s_addr, bindAddress.ia.sin_port);
+  bindAddress.ia.sin_addr.s_addr = htonl(INADDR_ANY);
+}
     retval = ::bind(socket, (sockaddr*)&(bindAddress.sa), sizeof(sockaddr));
     if(retval<0) {
         char errStr[64];


Heinz

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


Navigate by Date:
Prev: Build failed in Jenkins: epics-base-3.15-win32s-test #104 APS Jenkins
Next: Jenkins build became unstable: epics-base-3.14 #243 APS Jenkins
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-win32 #279 APS Jenkins
Next: Jenkins build became unstable: epics-base-3.14 #243 APS Jenkins
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 24 Apr 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·