fix: gracefully handling corrupted or not compatible alias databases (fixes #391)

This commit is contained in:
evilsocket 2018-11-22 13:06:29 +01:00
commit 85c2d0b4fa
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -2,6 +2,7 @@ package network
import (
"encoding/json"
"fmt"
"net"
"strings"
"sync"
@ -36,7 +37,7 @@ type lanJSON struct {
func NewLAN(iface, gateway *Endpoint, newcb EndpointNewCallback, lostcb EndpointLostCallback) *LAN {
aliases, err := data.NewUnsortedKV(aliasesFileName, data.FlushOnEdit)
if err != nil {
panic(err)
fmt.Printf("error loading %s: %s", aliasesFileName, err)
}
return &LAN{