Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
cope with router.Iface being nil
Browse files Browse the repository at this point in the history
which happens with `weave launch-router --iface ''`, which is what
multiweave invokes.
  • Loading branch information
rade committed Aug 11, 2015
1 parent 2b4d4fa commit ea0db16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion router/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ type LocalConnectionStatus struct {
}

func NewStatus(router *Router) *Status {
var ifaceName string
if router.Iface != nil {
ifaceName = router.Iface.Name
}
return &Status{
Protocol,
ProtocolMinVersion,
Expand All @@ -71,7 +75,7 @@ func NewStatus(router *Router) *Status {
router.Ourself.Name.String(),
router.Ourself.NickName,
router.Port,
router.Iface.Name,
ifaceName,
NewMACStatusSlice(router.Macs),
NewPeerStatusSlice(router.Peers),
NewUnicastRouteStatusSlice(router.Routes),
Expand Down

0 comments on commit ea0db16

Please sign in to comment.