Skip to content

Commit

Permalink
miniupnpd/minissdp.c: send ssdp:alive packets more than once
Browse files Browse the repository at this point in the history
fixes #35
  • Loading branch information
miniupnp committed Feb 25, 2014
1 parent a06c695 commit 9832adc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions miniupnpd/minissdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,22 @@ SendSSDPNotify(int s, const struct sockaddr * dest,
{
syslog(LOG_NOTICE, "sendto() sent %d out of %d bytes", n, l);
}
/* Due to the unreliable nature of UDP, devices SHOULD send the entire
* set of discovery messages more than once with some delay between
* sets e.g. a few hundred milliseconds. To avoid network congestion
* discovery messages SHOULD NOT be sent more than three times. */
n = sendto_schedule(s, bufr, l, 0, dest,
#ifdef ENABLE_IPV6
ipv6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in),
#else
sizeof(struct sockaddr_in),
#endif
250);
if(n < 0)
{
syslog(LOG_ERR, "sendto(udp_notify=%d, %s): %m", s,
host ? host : "NULL");
}
}

static void
Expand Down

0 comments on commit 9832adc

Please sign in to comment.