Fixed bug in network code.

Clients with blank hostname was causing IP to be ignored.
pull/29/head
Christopher Young 2015-09-01 23:06:19 -04:00
rodzic ecd29a8425
commit 7836fe55d3
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -57,6 +57,9 @@ func getDHCPLeases() (map[string]string, error) {
hostname := strings.TrimRight(strings.TrimLeft(strings.Join(spaced[3:], " "), "\""), "\";")
ret[block_ip] = hostname
open_block = false
} else if open_block && strings.HasPrefix(spaced[0], "}") { // No hostname.
open_block = false
ret[block_ip] = ""
}
}
return ret, nil