Fix handling of 127.0.0.1 instead of localhost for *sql plugins
[collectd.git] / src / mysql.c
index d15a055..6337ab4 100644 (file)
@@ -287,6 +287,7 @@ static void set_host (mysql_database_t *db, char *buf, size_t buflen)
 {
        if ((db->host == NULL)
                        || (strcmp ("", db->host) == 0)
+                       || (strcmp ("127.0.0.1", db->host) == 0)
                        || (strcmp ("localhost", db->host) == 0))
                sstrncpy (buf, hostname_g, buflen);
        else