18 Commits

Author SHA1 Message Date
Tobias Klauser
5f58ad60dd ipv4: use type IPMreqn from x/sys/unix
Use the IPMreqn type and the SizeofIPMreqn defined in the
golang.org/x/sys/unix package instead of locally duplicating them.

Change-Id: I98768e01fd4b0d1018892d5ed49455366a7356bb
Reviewed-on: https://go-review.googlesource.com/c/net/+/312490
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-04-23 18:45:38 +00:00
Tobias Klauser
d25e304258 ipv4: use all socket option consts from x/sys/unix
Remove the remaining local definitions of the IP_RECVDSTADDR, IP_RECVIF
and IP_RECVTTL socket option constants and use the constants defined in
the golang.org/x/sys/unix package instead.

Change-Id: I5308f5c5b3586e9d5c050e6cf126aeba48b47ba7
Reviewed-on: https://go-review.googlesource.com/c/net/+/311289
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-04-20 07:25:03 +00:00
Tobias Klauser
2c4c8ecb78 ipv4: use socket option consts from x/sys/unix on darwin
Use the socket option constants defined in the golang.org/x/sys/unix
package instead of duplicating them in this package.

Note that for now, sysIP_RECVDSTADDR, sysIP_RECVIF, sysIP_RECVTTL and
sysIP_PKTINFO still need to be defined because they are used in code
shared with other platforms.

Change-Id: I9bb953dc72dea19e9e9d84dc641346fe95bad070
Reviewed-on: https://go-review.googlesource.com/c/net/+/303909
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-03-24 05:16:36 +00:00
Tobias Klauser
be88a9aa50 ipv4, ipv6: directly initialize ctlOpts and sockOpts
After CL 156597 it's no longer necessary to initialize the ctlOpts and
sockOpts tables in the init func. Instead, just directly initialize them.

Change-Id: I62b4dd980b3cb87e3cbc71ea4874f6512b5cfefa
Reviewed-on: https://go-review.googlesource.com/c/156797
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-08 15:08:41 +00:00
Tobias Klauser
45ffb0cd1b ipv4, ipv6: drop support for macOS 10.7 and earlier
Drop the check for macOS 10.7 and earlier. Go 1.11 requires at least
macOS 10.10 and macOS 10.7 is no longer supported by Apple anyhow.

Change-Id: Ie7d9d27e0b9156ea478bf560734f4a85dfa163d6
Reviewed-on: https://go-review.googlesource.com/c/156597
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-07 21:02:23 +00:00
Mikio Hara
c4fa6e0d08 ipv4: plumb in the standard library of Go 1.9 by using internal/socket package
This change uses the internal/socket package to ensure that the ipv4
package works with all supported versions of the Go standard library.

Fixes golang/go#19051.

Change-Id: If0256007c749c319970533823a10afdc1ffbce31
Reviewed-on: https://go-review.googlesource.com/37036
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-24 08:42:31 +00:00
Mikio Hara
2497afe528 ipv4: simplify init function for darwin
Change-Id: Id87fcbe2d827f5b3ee3b7387e1bbf64287a397bf
Reviewed-on: https://go-review.googlesource.com/33811
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-01-13 08:34:03 +00:00
Mikio Hara
a14f429b86 ipv4: rename internal types and constants generated by cgo
To match up with other packages that work with IP protocol stack.

Change-Id: I2d20e4194617b05b6b46d6fba5df1f6c12ae2793
Reviewed-on: https://go-review.googlesource.com/30574
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-10-07 03:58:42 +00:00
Mikio Hara
534e18705b ipv4: don't refer to cgo-generated union field
The size of sockaddr_storage is fixed for interoperability on each
platform. There is no need to depend on changable cgo-generated
offset values.

Change-Id: I7469fe330d49867bbdbdfae128834140244925ec
Reviewed-on: https://go-review.googlesource.com/30177
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-10-06 03:49:48 +00:00
Mikio Hara
37db164db4 ipv4: remove unnecessary sysSockoptLen type
Change-Id: I367d38bca99ede07aa0cf697547c5cb43ce4e164
Reviewed-on: https://go-review.googlesource.com/21353
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-31 04:06:34 +00:00
Mikio Hara
c220db412d x/net/ipv4: enable IP_STRIPHDR by default on darwin
According to github.com/opensource-apple/xnu.git, IP_STRIPHDR sticky
socket option was introduced in xnu-517 (Darwin 7.0, OS X 10.3).

LGTM=iant
R=iant, gobot
CC=golang-codereviews
https://golang.org/cl/176480043
2014-12-02 13:11:09 +09:00
Mikio Hara
5c9495a327 x/net/ipv4: enable IP_STRIPHDR sticky socket option on latest darwin kernels
This reduces allocation and copy ops with net.IPConn-based
ipv4.PacketConn on latest darwin kernels.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/184770043
2014-11-29 10:17:57 +09:00
Mikio Hara
724ab9af50 x/net/ipv4: fix build on older darwin kernels
A few adjustments for test cases will come in a following CL.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/179760044
2014-11-16 08:24:54 +09:00
Mikio Hara
0d3526158c x/net/ipv4: don't enable advanced features on OS X 10.7 and below
Looks like OS X 10.8 is the safe harbor.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/167630043
2014-11-13 07:19:05 +09:00
Mikio Hara
153a6a6152 x/net/ipv4: add sticky source-specific multicast socket options
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/173100043
2014-11-12 12:59:23 +09:00
Mikio Hara
edb50c0ae2 go.net/ipv4: restructure ancillary data socket option handling
This CL chops existing ancillary data socket option handlers and
puts them into platform dependent ancillary data socket option
binding table for code readability.

Fixes golang/go#6710.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/153860043
2014-10-04 09:51:11 +09:00
Mikio Hara
353547e1a2 go.net/ipv4: restructure sticky socket option handling
This CL chops existing sticky socket option handlers and puts them
into platform dependent sticky socket option binding table for
supporting multicast features such as source filtering for any-source
multicast, source-specific multicast.

Also adds tiny syscall shims to help to support solaris, to improve
existing platform support.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/140640045
2014-10-04 08:12:41 +09:00
Mikio Hara
38dcae4017 go.net/ipv4: add support for dragonfly, enable IP_PKTINFO on darwin
This CL adds support for dragonfly and IP_PKTINFO support for darwin
with less dependency on syscall package.

Update golang/go#7175
Fixes golang/go#7172.

LGTM=iant
R=golang-codereviews, gobot, iant
CC=golang-codereviews
https://golang.org/cl/97800043
2014-05-19 12:20:11 +09:00