Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check the return value from setsockopt and log errors
Fixes coverty 700269

Fixes #11611.

Signed-off-by: Paul Harrison <pharrison@mythtv.org>
  • Loading branch information
garybuhrmaster authored and Paul Harrison committed Jul 1, 2013
1 parent c416822 commit 0dc5195
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mythtv/libs/libmythupnp/mmulticastsocketdevice.cpp
Expand Up @@ -106,8 +106,13 @@ qint64 MMulticastSocketDevice::writeBlock(
continue; // skip localhost address

uint32_t interface_addr = (*it).toIPv4Address();
setsockopt(socket(), IPPROTO_IP, IP_MULTICAST_IF,
(const char *)&interface_addr, sizeof(interface_addr));
if (setsockopt(socket(), IPPROTO_IP, IP_MULTICAST_IF,
(const char *)&interface_addr,
sizeof(interface_addr)) < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"setsockopt - IP_MULTICAST_IF " + ENO);
}
retx = MSocketDevice::writeBlock(data, len, host, port);
#if 0
LOG(VB_GENERAL, LOG_DEBUG, LOC + QString("writeBlock on %1 %2")
Expand Down

0 comments on commit 0dc5195

Please sign in to comment.