diff --git a/route/address.go b/route/address.go index 5443d67223..9aa2ee113d 100644 --- a/route/address.go +++ b/route/address.go @@ -172,7 +172,8 @@ func (a *Inet6Addr) marshal(b []byte) (int, error) { func parseInetAddr(af int, b []byte) (Addr, error) { switch af { case syscall.AF_INET: - if len(b) < sizeofSockaddrInet { + l := int(b[0]) + if len(b) < l { return nil, errInvalidAddr } a := &Inet4Addr{}