Skip to content

Commit 2484f30

Browse files
committed
trying to fix macos unittest
1 parent 6bbde3f commit 2484f30

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

include/slick/socket/multicast_sender_unix.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,20 @@ bool MulticastSenderBase<DerivedT>::setup_multicast_options()
177177

178178
// Set TTL for multicast packets
179179
int ttl = config_.ttl;
180-
if (setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_TTL, reinterpret_cast<const char*>(&ttl), sizeof(ttl)) < 0)
180+
if (setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0)
181181
{
182182
int error = errno;
183-
LOG_ERROR("Failed to set multicast TTL. error={} ({})", error, strerror(error));
184-
return false;
183+
LOG_WARN("Failed to set multicast TTL. error={} ({})", error, strerror(error));
184+
// Don't fail - TTL might not be settable on all platforms
185185
}
186186

187187
// Set multicast loopback
188188
int loopback = config_.enable_loopback ? 1 : 0;
189-
if (setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_LOOP, reinterpret_cast<const char*>(&loopback), sizeof(loopback)) < 0)
189+
if (setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback, sizeof(loopback)) < 0)
190190
{
191191
int error = errno;
192-
LOG_ERROR("Failed to set multicast loopback. error={} ({})", error, strerror(error));
193-
return false;
192+
LOG_WARN("Failed to set multicast loopback. error={} ({})", error, strerror(error));
193+
// Don't fail - loopback might not be settable on all platforms
194194
}
195195

196196
// Set multicast interface if specified
@@ -200,11 +200,11 @@ bool MulticastSenderBase<DerivedT>::setup_multicast_options()
200200
int result = inet_pton(AF_INET, config_.interface_address.c_str(), &interface_addr);
201201
if (result == 1)
202202
{
203-
if (setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_IF, reinterpret_cast<const char*>(&interface_addr), sizeof(interface_addr)) < 0)
203+
if (setsockopt(socket_, IPPROTO_IP, IP_MULTICAST_IF, &interface_addr, sizeof(interface_addr)) < 0)
204204
{
205205
int error = errno;
206-
LOG_ERROR("Failed to set multicast interface. error={} ({})", error, strerror(error));
207-
return false;
206+
LOG_WARN("Failed to set multicast interface. error={} ({})", error, strerror(error));
207+
// Don't fail - interface might not be settable on all platforms
208208
}
209209
}
210210
else

0 commit comments

Comments
 (0)