- Fix that https is set up as enabled when the port is listed in

interface-automatic-ports. Also for the set up of quic it is
  enabled when listed there.
This commit is contained in:
W.C.A. Wijngaards 2025-10-02 10:16:06 +02:00
parent feeebc95f8
commit adaf5dab49
3 changed files with 40 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2 October 2025: Wouter
- Fix that https is set up as enabled when the port is listed in
interface-automatic-ports. Also for the set up of quic it is
enabled when listed there.
30 September 2025: Wouter
- Fix for #1344: Fix that respip and dns64 can be enabled at the
same time, the client info is copied for attach_sub and add_sub

View file

@ -2922,6 +2922,29 @@ if_is_quic(const char* ifname, int default_port, int quic_port)
#endif
}
int
cfg_ports_list_contains(char* ports, int p)
{
char* now = ports, *after;
int extraport;
while(now && *now) {
while(isspace((unsigned char)*now))
now++;
if(!now)
break;
after = now;
extraport = (int)strtol(now, &after, 10);
if(extraport < 0 || extraport > 65535)
continue; /* Out of range. */
if(extraport == 0 && now == after)
return 0; /* Number could not be parsed. */
now = after;
if(extraport == p)
return 1;
}
return 0;
}
int
cfg_has_https(struct config_file* cfg)
{
@ -2930,6 +2953,8 @@ cfg_has_https(struct config_file* cfg)
if(if_is_https(cfg->ifs[i], cfg->port, cfg->https_port))
return 1;
}
if(cfg_ports_list_contains(cfg->if_automatic_ports, cfg->https_port))
return 1;
return 0;
}
@ -2942,6 +2967,8 @@ cfg_has_quic(struct config_file* cfg)
if(if_is_quic(cfg->ifs[i], cfg->port, cfg->quic_port))
return 1;
}
if(cfg_ports_list_contains(cfg->if_automatic_ports, cfg->quic_port))
return 1;
return 0;
#else
(void)cfg;

View file

@ -1480,4 +1480,12 @@ int cfg_has_quic(struct config_file* cfg);
/** get memory for string */
size_t getmem_str(char* str);
/**
* See if the if_automatic_ports list contains the value.
* @param ports: String with port numbers.
* @param p: number looked for.
* @return true if found, false if not found or parse failure.
*/
int cfg_ports_list_contains(char* ports, int p);
#endif /* UTIL_CONFIG_FILE_H */