kopia lustrzana https://github.com/cyoung/stratux
force sending to statically configured IPs and ARP cache, even if dhcp leases cannot be parsed
rodzic
0cc15753b9
commit
a54aaeebf5
|
@ -61,9 +61,8 @@ func getDHCPLeases() (map[string]string, error) {
|
||||||
}
|
}
|
||||||
dat, err := ioutil.ReadFile(dhcp_lease_file)
|
dat, err := ioutil.ReadFile(dhcp_lease_file)
|
||||||
ret := make(map[string]string)
|
ret := make(map[string]string)
|
||||||
if err != nil {
|
|
||||||
return ret, err
|
if err == nil {
|
||||||
}
|
|
||||||
lines := strings.Split(string(dat), "\n")
|
lines := strings.Split(string(dat), "\n")
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
spaced := strings.Split(line, " ")
|
spaced := strings.Split(line, " ")
|
||||||
|
@ -76,6 +75,7 @@ func getDHCPLeases() (map[string]string, error) {
|
||||||
ret[ip] = host
|
ret[ip] = host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add IP's set through the settings page
|
// Add IP's set through the settings page
|
||||||
if globalSettings.StaticIps != nil {
|
if globalSettings.StaticIps != nil {
|
||||||
|
|
Ładowanie…
Reference in New Issue