remove the ip in host_in_db in order to avoid the dhcp false positives
This commit is contained in:
parent
0c49949a5d
commit
918ffe1b5b
3 changed files with 13 additions and 6 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -2,3 +2,9 @@
|
||||||
data/
|
data/
|
||||||
watchyourlan
|
watchyourlan
|
||||||
tmp/
|
tmp/
|
||||||
|
/src/db.sqlite
|
||||||
|
/.idea/modules.xml
|
||||||
|
/.idea/vcs.xml
|
||||||
|
/.idea/WatchYourLAN.iml
|
||||||
|
/.idea/.gitignore
|
||||||
|
/.idea/golinter.xml
|
||||||
|
|
|
||||||
1
Makefile
1
Makefile
|
|
@ -40,3 +40,4 @@ clean:
|
||||||
docker rmi -f $(DUSER)/$(DNAME)
|
docker rmi -f $(DUSER)/$(DNAME)
|
||||||
|
|
||||||
dev: docker-build docker-run
|
dev: docker-build docker-run
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
|
|
||||||
func host_in_db(host Host, dbHosts []Host) bool { // Check if host is already in DB
|
func host_in_db(host Host, dbHosts []Host) bool { // Check if host is already in DB
|
||||||
for _, oneHost := range dbHosts {
|
for _, oneHost := range dbHosts {
|
||||||
if host.Ip == oneHost.Ip && host.Mac == oneHost.Mac && host.Hw == oneHost.Hw {
|
if host.Mac == oneHost.Mac && host.Hw == oneHost.Hw {
|
||||||
oneHost.Date = host.Date
|
oneHost.Date = host.Date
|
||||||
oneHost.Now = 1
|
oneHost.Now = 1
|
||||||
db_update(oneHost)
|
db_update(oneHost)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue