miniupnpd.c: fix enforcing min_lifetime minimum of 120secs

This commit is contained in:
Thomas Bernard 2024-01-08 00:24:07 +01:00
parent 93b44ed36d
commit aefebb18cb
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
1 changed files with 3 additions and 1 deletions

View File

@ -1414,12 +1414,14 @@ init(int argc, char * * argv, struct runtime_vars * v)
#ifdef ENABLE_PCP
case UPNPPCPMINLIFETIME:
min_lifetime = atoi(ary_options[i].value);
if (min_lifetime > 120 ) {
/* RFC6887 15. the minimum value SHOULD be 120 seconds */
if (min_lifetime < 120 ) {
min_lifetime = 120;
}
break;
case UPNPPCPMAXLIFETIME:
max_lifetime = atoi(ary_options[i].value);
/* maximum is 24 hours */
if (max_lifetime > 86400 ) {
max_lifetime = 86400;
}