mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 11:05:45 +00:00
net/netmon: catch ParseRIB panic to gather buffer data
Updates #14201 Updates golang/go#70528 Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
parent
36b7449fea
commit
f6431185b0
@ -56,7 +56,15 @@ func (m *darwinRouteMon) Receive() (message, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
msgs, err := route.ParseRIB(route.RIBTypeRoute, m.buf[:n])
|
msgs, err := func() (msgs []route.Message, err error) {
|
||||||
|
defer func() {
|
||||||
|
if recover() != nil {
|
||||||
|
msgs = nil
|
||||||
|
err = fmt.Errorf("panic parsing route message")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return route.ParseRIB(route.RIBTypeRoute, m.buf[:n])
|
||||||
|
}()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if debugRouteMessages {
|
if debugRouteMessages {
|
||||||
m.logf("read %d bytes (% 02x), failed to parse RIB: %v", n, m.buf[:n], err)
|
m.logf("read %d bytes (% 02x), failed to parse RIB: %v", n, m.buf[:n], err)
|
||||||
|
Loading…
Reference in New Issue
Block a user