2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 <2017> 2018 2019 2020 2021 2022 2023 2024 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 <2017> 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | binding in pvAccessCPP/src/remote/blockingUDPConnector.cpp (bundleCPP) needs INADDR_ANY in addr for RTEMS 4.12 |
From: | Heinz Junkes <[email protected]> |
To: | [email protected] |
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