diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index 1c5e1ff..3a29ebf 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -3,6 +3,7 @@ $Id: Changelog.txt,v 1.394 2014/12/10 09:33:24 nanard Exp $ 2014/12/10: Checking Host: HTTP request header to prevent DNS rebinding attack configurable BOOTID.UPNP.ORG SSDP header + use time for BOOTID.UPNP.ORG value 2014/12/09: fix upnp_add_inboundpinhole() : check inet_pton() return diff --git a/miniupnpd/genconfig.sh b/miniupnpd/genconfig.sh index 83f305c..ee63817 100755 --- a/miniupnpd/genconfig.sh +++ b/miniupnpd/genconfig.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $Id: genconfig.sh,v 1.77 2014/12/04 10:21:33 nanard Exp $ +# $Id: genconfig.sh,v 1.78 2014/12/10 09:34:42 nanard Exp $ # miniupnp daemon # http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/ # (c) 2006-2014 Thomas Bernard @@ -518,6 +518,12 @@ cat >> ${CONFIGFILE} <> ${CONFIGFILE} <> ${CONFIGFILE} ${MV} ${CONFIGFILE} ${CONFIGFILE_FINAL} diff --git a/miniupnpd/miniupnpd.c b/miniupnpd/miniupnpd.c index 1e6e37c..0263dba 100644 --- a/miniupnpd/miniupnpd.c +++ b/miniupnpd/miniupnpd.c @@ -599,6 +599,16 @@ static void set_startup_time(int sysuptime) { startup_time = time(NULL); +#ifdef USE_TIME_AS_BOOTID + if(startup_time > 60*60*24 && upnp_bootid == 1) { + /* We know we are not January the 1st 1970 */ + upnp_bootid = (unsigned int)startup_time; + /* from UDA v1.1 : + * A convenient mechanism is to set this field value to the time + * that the device sends its initial announcement, expressed as + * seconds elapsed since midnight January 1, 1970; */ + } +#endif /* USE_TIME_AS_BOOTID */ if(sysuptime) { /* use system uptime instead of daemon uptime */