diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index ef2c1633c..596ce25de 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1021,6 +1021,10 @@ void Module::setDestinationUDPIP(const IpAddr ip) { if (ip == 0) { throw RuntimeError("Invalid destination udp ip address"); } + if (ip.str() == LOCALHOST_IP) { + throw RuntimeError("Invalid destination udp ip. Change rx_hostname " + "from localhost or change udp_dstip from auto?"); + } sendToDetector(F_SET_DEST_UDP_IP, ip, nullptr); if (shm()->useReceiverFlag) { sls::MacAddr retval(0LU); @@ -1040,7 +1044,10 @@ void Module::setDestinationUDPIP2(const IpAddr ip) { if (ip == 0) { throw RuntimeError("Invalid destination udp ip address2"); } - + if (ip.str() == LOCALHOST_IP) { + throw RuntimeError("Invalid destination udp ip. Change rx_hostname " + "from localhost or change udp_dstip from auto?"); + } sendToDetector(F_SET_DEST_UDP_IP2, ip, nullptr); if (shm()->useReceiverFlag) { sls::MacAddr retval(0LU); @@ -3330,9 +3337,9 @@ sls_detector_module Module::interpolateTrim(sls_detector_module *a, dacs_to_copy.end(), {E_SVP, E_SVN, E_VTGSTV, E_RXB_RB, E_RXB_LB, E_VCN, E_VIS}); // interpolate vrf, vcmp, vcp - dacs_to_interpolate.insert( - dacs_to_interpolate.end(), - {E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR, E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS}); + dacs_to_interpolate.insert(dacs_to_interpolate.end(), + {E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR, + E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS}); } else { dacs_to_copy.insert(dacs_to_copy.end(), {M_VCASSH, M_VRSHAPER, M_VRSHAPER_N, M_VIPRE_OUT, diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index 44677a8f6..55979eeec 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -1388,6 +1388,10 @@ int ClientInterface::set_read_n_rows(Interface &socket) { } sls::MacAddr ClientInterface::setUdpIp(sls::IpAddr arg) { + if (arg.str() == LOCALHOST_IP) { + throw RuntimeError("Invalid destination udp ip. Change rx_hostname " + "from localhost or change udp_dstip from auto?"); + } LOG(logINFO) << "Received UDP IP: " << arg; // getting eth std::string eth = sls::IpToInterfaceName(arg.str()); @@ -1426,6 +1430,10 @@ int ClientInterface::set_udp_ip(Interface &socket) { } sls::MacAddr ClientInterface::setUdpIp2(sls::IpAddr arg) { + if (arg.str() == LOCALHOST_IP) { + throw RuntimeError("Invalid destination udp ip. Change rx_hostname " + "from localhost or change udp_dstip from auto?"); + } LOG(logINFO) << "Received UDP IP2: " << arg; // getting eth std::string eth = sls::IpToInterfaceName(arg.str()); diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 06203310f..b4ceced11 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -65,6 +65,8 @@ #define DEFAULT_DET_MAC2 "00:aa:bb:cc:dd:ff" #define DEFAULT_DET_IP2 "129.129.202.46" +#define LOCALHOST_IP "127.0.0.1" + /** default maximum string length */ #define MAX_STR_LENGTH 1000 #define SHORT_STR_LENGTH 20 @@ -564,7 +566,7 @@ enum streamingInterface { #ifdef __cplusplus }; -//operators needed in ToString +// operators needed in ToString inline slsDetectorDefs::streamingInterface operator|(const slsDetectorDefs::streamingInterface &a, const slsDetectorDefs::streamingInterface &b) { @@ -579,8 +581,6 @@ operator&(const slsDetectorDefs::streamingInterface &a, static_cast(b)); }; - - #endif #ifdef __cplusplus