From 258bf65d8b157bfe311ce70c93dd854022a25c9d Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Tue, 23 Jun 2015 21:40:33 +0900 Subject: net: relax IP interface address determination on linux Linux allows to have a peer IP address on IP interface over ethernet link encapsulation, though it only installs a static route with the peer address as an on-link nexthop. Fixes #11338. Change-Id: Ie2583737e4c7cec39baabb89dd732463d3f10a61 Reviewed-on: https://go-review.googlesource.com/11352 Reviewed-by: Russ Cox --- src/net/interface_linux.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/net/interface_linux.go') diff --git a/src/net/interface_linux.go b/src/net/interface_linux.go index 6551a3562e..ef2042920e 100644 --- a/src/net/interface_linux.go +++ b/src/net/interface_linux.go @@ -176,17 +176,15 @@ func newAddr(ifi *Interface, ifam *syscall.IfAddrmsg, attrs []syscall.NetlinkRou var ipPointToPoint bool // Seems like we need to make sure whether the IP interface // stack consists of IP point-to-point numbered or unnumbered - // addressing over point-to-point link encapsulation. - if ifi.Flags&FlagPointToPoint != 0 { - for _, a := range attrs { - if a.Attr.Type == syscall.IFA_LOCAL { - ipPointToPoint = true - break - } + // addressing. + for _, a := range attrs { + if a.Attr.Type == syscall.IFA_LOCAL { + ipPointToPoint = true + break } } for _, a := range attrs { - if ipPointToPoint && a.Attr.Type == syscall.IFA_ADDRESS || !ipPointToPoint && a.Attr.Type == syscall.IFA_LOCAL { + if ipPointToPoint && a.Attr.Type == syscall.IFA_ADDRESS { continue } switch ifam.Family { -- cgit v1.3-5-g9baa