minor. removed warning print at startup for empty eth udp to listen to (#992)

This commit is contained in:
maliakal_d 2024-10-01 12:05:00 +02:00 committed by GitHub
parent f2f3817a7f
commit 45957391a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 8 deletions

View File

@ -805,7 +805,7 @@ void Implementation::stopReceiver() {
} }
TLogLevel lev = ((mp[i]) > 0) ? logINFORED : logINFOGREEN; TLogLevel lev = ((mp[i]) > 0) ? logINFORED : logINFOGREEN;
LOG(lev) << "Summary of Port " << udpPortNum[i] << summary; LOG(lev) << "Summary of Port " << udpPortNum[i] << " (" << eth[i] << ')' << summary;
} }
// callback // callback

View File

@ -81,10 +81,6 @@ void Listener::SetEthernetInterface(const std::string e) {
if (eth.find('.') != std::string::npos) { if (eth.find('.') != std::string::npos) {
eth = ""; eth = "";
} }
if (!eth.length()) {
LOG(logWARNING) << "ethernet interface for udp port " << udpPortNumber
<< " is empty. Listening to all";
}
} }
void Listener::SetActivate(bool enable) { void Listener::SetActivate(bool enable) {
@ -153,12 +149,13 @@ void Listener::CreateUDPSocket(int &actualSize) {
packetSize = generalData->vetoPacketSize; packetSize = generalData->vetoPacketSize;
} }
std::string ip = (eth.length() ? InterfaceNameToIp(eth).str().c_str() : "");
udpSocket = nullptr; udpSocket = nullptr;
udpSocket = make_unique<UdpRxSocket>( udpSocket = make_unique<UdpRxSocket>(
udpPortNumber, packetSize, udpPortNumber, packetSize, (ip.length() ? ip.c_str() : nullptr),
(eth.length() ? InterfaceNameToIp(eth).str().c_str() : nullptr),
generalData->udpSocketBufferSize); generalData->udpSocketBufferSize);
LOG(logINFO) << index << ": UDP port opened at port " << udpPortNumber; LOG(logINFO) << index << ": UDP port opened at port " << udpPortNumber << " (" << (ip.length() ? ip : "any") << ')';
udpSocketAlive = true; udpSocketAlive = true;