minissdp.c: const int on = 1; for setsockopt() arg

This commit is contained in:
Thomas Bernard 2017-05-24 11:04:20 +02:00
parent efb0498133
commit 6ed6b4e607
1 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ OpenAndConfSSDPReceiveSocket(int ipv6)
struct sockaddr_storage sockname;
socklen_t sockname_len;
struct lan_addr_s * lan_addr;
int j = 1;
const int on = 1;
if( (s = socket(ipv6 ? PF_INET6 : PF_INET, SOCK_DGRAM, 0)) < 0)
{
@ -185,7 +185,7 @@ OpenAndConfSSDPReceiveSocket(int ipv6)
sockname_len = sizeof(struct sockaddr_in);
}
if(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &j, sizeof(j)) < 0)
if(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
{
syslog(LOG_WARNING, "setsockopt(udp, SO_REUSEADDR): %m");
}