mirror of
https://github.com/vishvananda/netlink
synced 2024-12-28 01:22:18 +00:00
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
This commit is contained in:
parent
14e832ae1e
commit
53455394aa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user