diff --git a/src/io.c b/src/io.c index ee4f0280..a86d6ad7 100644 --- a/src/io.c +++ b/src/io.c @@ -473,7 +473,7 @@ static void *ssl_read(void *arg) if (tunnel->state == STATE_CONNECTING) { if (packet_is_ip_plus_dns(packet)) { - char line[ARRAY_SIZE("[xxx.xxx.xxx.xxx], ns [xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx]")]; + char line[ARRAY_SIZE("[xxx.xxx.xxx.xxx], ns [xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx], ns_suffix []") + MAX_DOMAIN_LENGTH]; set_tunnel_ips(tunnel, packet); strcpy(line, "["); @@ -482,6 +482,8 @@ static void *ssl_read(void *arg) strncat(line, inet_ntoa(tunnel->ipv4.ns1_addr), 15); strcat(line, ", "); strncat(line, inet_ntoa(tunnel->ipv4.ns2_addr), 15); + strcat(line, "], ns_suffix ["); + strncat(line, tunnel->ipv4.dns_suffix, MAX_DOMAIN_LENGTH); strcat(line, "]"); log_info("Got addresses: %s\n", line); } diff --git a/src/ipv4.h b/src/ipv4.h index 3c6826ee..56bf1dc9 100644 --- a/src/ipv4.h +++ b/src/ipv4.h @@ -64,6 +64,10 @@ struct rtentry { #define MAX_SPLIT_ROUTES 65535 #define STEP_SPLIT_ROUTES 32 +// see https://unix.stackexchange.com/questions/245849 +// ... /resolv-conf-limited-to-six-domains-with-a-total-of-256-characters +#define MAX_DOMAIN_LENGTH 256 + struct ipv4_config { struct in_addr ip_addr; diff --git a/src/xml.c b/src/xml.c index a4e7e140..32760dea 100644 --- a/src/xml.c +++ b/src/xml.c @@ -16,6 +16,7 @@ */ #include "xml.h" +#include "ipv4.h" #include "log.h" #include diff --git a/src/xml.h b/src/xml.h index db76a9de..aaf38027 100644 --- a/src/xml.h +++ b/src/xml.h @@ -18,10 +18,6 @@ #ifndef OPENFORTIVPN_XML_H #define OPENFORTIVPN_XML_H -#define MAX_DOMAIN_LENGTH 256 -// see https://unix.stackexchange.com/questions/245849 -// ... /resolv-conf-limited-to-six-domains-with-a-total-of-256-characters - const char *xml_find(char t, const char *tag, const char *buf, int nest); char *xml_get(const char *buf);