diff options
| author | Mikio Hara <mikioh.mikioh@gmail.com> | 2015-06-23 21:40:33 +0900 |
|---|---|---|
| committer | Mikio Hara <mikioh.mikioh@gmail.com> | 2015-06-27 00:39:30 +0000 |
| commit | 258bf65d8b157bfe311ce70c93dd854022a25c9d (patch) | |
| tree | bc248520f7297c884d21aee39d1af197b18d5735 /src/net/interface_linux.go | |
| parent | aea348a3af088bc3bc05c5ee5cfc567215008f6f (diff) | |
| download | go-258bf65d8b157bfe311ce70c93dd854022a25c9d.tar.xz | |
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 <rsc@golang.org>
Diffstat (limited to 'src/net/interface_linux.go')
| -rw-r--r-- | src/net/interface_linux.go | 14 |
1 files changed, 6 insertions, 8 deletions
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 { |
