1
0
mirror of https://github.com/golang/go synced 2024-11-16 20:54:48 -07:00

net: don't check nil err twice in interfaceMessages on freebsd

Change-Id: Ie614e49d07b24c5b3dde469561893643bc858d1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/312389
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Tobias Klauser 2021-04-21 20:23:50 +02:00 committed by Tobias Klauser
parent 614a9c2613
commit 1d2101116f

View File

@ -16,10 +16,10 @@ func interfaceMessages(ifindex int) ([]route.Message, error) {
if err != nil {
typ = route.RIBType(syscall.NET_RT_IFLIST)
rib, err = route.FetchRIB(syscall.AF_UNSPEC, typ, ifindex)
}
if err != nil {
return nil, err
}
}
return route.ParseRIB(typ, rib)
}