From: Jaroslav Kysela Date: Tue, 4 Apr 2017 19:05:49 +0000 (+0200) Subject: udp: fix empty multicast_src check X-Git-Tag: v4.2.1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec79a94267b8fbc7ea782be0928019d52c379f26;p=thirdparty%2Ftvheadend.git udp: fix empty multicast_src check --- diff --git a/src/udp.c b/src/udp.c index 20adf3747..2db18e05d 100644 --- a/src/udp.c +++ b/src/udp.c @@ -212,7 +212,7 @@ udp_bind ( int subsystem, const char *name, if (uc->multicast) { /* Join multicast group */ - if (multicast_src) { + if (multicast_src && *multicast_src) { /* Join with specific source address (SSM) */ struct ip_mreq_source ms; memset(&ms, 0, sizeof(ms)); @@ -223,13 +223,13 @@ udp_bind ( int subsystem, const char *name, so we have to resolve to the ip of the interface on all platforms. */ if (udp_get_ifaddr(fd, ifname, &ms.imr_interface) == -1) { tvherror(subsystem, "%s - cannot find ip address for interface %s [e=%s]", - name, ifname, strerror(errno)); + name, ifname, strerror(errno)); goto error; } if (inet_pton(AF_INET, multicast_src, &ms.imr_sourceaddr) < 1) { tvherror(subsystem, "%s - invalid ipv4 address '%s' specified as multicast source [e=%s]", - name, multicast_src, strerror(errno)); + name, multicast_src, strerror(errno)); goto error; }