Don't crash when printing name of nil interface

This commit is contained in:
Bryan Boreham committed 2014-10-24 12:37:28 +01:00
1 parent ad44a8816f
commit 5f3080b9db
1 file changed
+5 -1
+5 -1
View File
@@ -88,7 +88,11 @@ func StartServer(zone Zone, iface *net.Interface, dnsPort int, httpPort int, wai
mdnsClient, err := NewMDNSClient()
checkFatal(err)
Info.Printf("Using mDNS on %s", iface.Name)
ifaceName := "default interface"
if iface != nil {
ifaceName = iface.Name
}
Info.Printf("Using mDNS on %s", ifaceName)
err = mdnsClient.Start(iface)
checkFatal(err)