m/n/core/network: fix panic

If the channel is closed, then u.Link is nil, and calling .Attrs() on it
causes a nil pointer dereference panic.

Change-Id: I2d1b7b4e38957e6a55ef663876ac571e2dd6d3c1
Reviewed-on: https://review.monogon.dev/c/monogon/+/3809
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/node/core/network/neigh.go b/metropolis/node/core/network/neigh.go
index 0d434ab..c779d73 100644
--- a/metropolis/node/core/network/neigh.go
+++ b/metropolis/node/core/network/neigh.go
@@ -34,7 +34,10 @@
 	lastIfState := make(map[string]bool)
 	for {
 		select {
-		case u := <-linkUpdates:
+		case u, ok := <-linkUpdates:
+			if !ok {
+				return fmt.Errorf("link update channel closed")
+			}
 			attrs := u.Link.Attrs()
 			before := lastIfState[attrs.Name]
 			now := attrs.RawFlags&unix.IFF_RUNNING != 0