From 53455394aa2b7ada7a308d0328747acdd05e91d5 Mon Sep 17 00:00:00 2001 From: Joe Swantek Date: Mon, 28 Jun 2021 13:50:44 -0500 Subject: [PATCH] Correct panic when IPv4 lacks IFA_ADDRESS address IFA_ADDRESS is to be used as the peer address if it differs from IFA_LOCAL. Therefore, include the check for "no IFA_ADDRESS" in the difference check. Example: ppp interfaces can contain IFA_LOCAL and no IFA_ADDRESS attribute --- addr_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addr_linux.go b/addr_linux.go index 0614379..e4a167d 100644 --- a/addr_linux.go +++ b/addr_linux.go @@ -268,7 +268,7 @@ func parseAddr(m []byte) (addr Addr, family int, err error) { // But obviously, as there are IPv6 PtP addresses, too, // IFA_LOCAL should also be handled for IPv6. if local != nil { - if family == FAMILY_V4 && local.IP.Equal(dst.IP) { + if family == FAMILY_V4 && dst != nil && local.IP.Equal(dst.IP) { addr.IPNet = dst } else { addr.IPNet = local