* domains
*/
+#if USE_IPV6
+ /* For IPV6 addresses also check for a colon */
+ if (Config.appendDomain && !strchr(lc_host, '.') && !strchr(lc_host, ':'))
+#else
if (Config.appendDomain && !strchr(lc_host, '.'))
+#endif
strncat(lc_host, Config.appendDomain, SQUIDHOSTNAMELEN -
strlen(lc_host) - 1);
LOCAL_ARRAY(char, host, SQUIDHOSTNAMELEN + 1);
xstrncpy(host, getMyHostname(), SQUIDHOSTNAMELEN);
+#if USE_IPV6
+ /* For IPV6 addresses also check for a colon */
+ if (Config.appendDomain && !strchr(host, '.') && !strchr(host, ':'))
+#else
if (Config.appendDomain && !strchr(host, '.'))
+#endif
strncat(host, Config.appendDomain, SQUIDHOSTNAMELEN -
strlen(host) - 1);
*nt = '\0';
debugs(1, 5, "etc_hosts: got hostname '" << lt << "'");
+#if USE_IPV6
+ /* For IPV6 addresses also check for a colon */
+ if (Config.appendDomain && !strchr(lt, '.') && !strchr(lt, ':')) {
+#else
if (Config.appendDomain && !strchr(lt, '.')) {
+#endif
/* I know it's ugly, but it's only at reconfig */
strncpy(buf2, lt, 512);
strncat(buf2, Config.appendDomain, 512 - strlen(lt) - 1);
return NULL;
}
+#if USE_IPV6
+ /* For IPV6 addresses also check for a colon */
+ if (Config.appendDomain && !strchr(host, '.') && !strchr(host, ':'))
+#else
if (Config.appendDomain && !strchr(host, '.'))
+#endif
strncat(host, Config.appendDomain, SQUIDHOSTNAMELEN - strlen(host) - 1);
/* remove trailing dots from hostnames */