+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
#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)
{
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;
}
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;
/** 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 */