8 Commits

Author SHA1 Message Date
Mikio Hara
1272bf9dcd ipv4: work around FreeBSD 11.3 or 12 kernel running COMPAT_FREEBSD32
On FreeBSD 11.3 or 12 kernel running COMPAT_FREEBSD32, it looks like the
system call recvmsg always returns an incorrect length for the
out-of-band data. This change adjusts the length when it looks incorrect
and the running kernel is FreeBSD 11.3 or above.

Fixes golang/go#30899.

Change-Id: Ia58d8b4bd4caf3783d2e38161ee4afd1a64ca522
Reviewed-on: https://go-review.googlesource.com/c/net/+/168297
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-20 06:40:53 +00:00
Mikio Hara
d196dffd7c Revert "ipv4: work around FreeBSD 12 kernel running COMPAT_FREEBSD32"
This reverts commit 7a92b5139a.

Reason for revert: not completely functional on FreeBSD 12 or above and
broke FreeBSD 11 or below.

Change-Id: Icd43d9ecebc0059a577751802e589a6e5f0cd363
Reviewed-on: https://go-review.googlesource.com/c/net/+/168078
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
Reviewed-by: Mikio Hara <mikioh.public.networking@gmail.com>
2019-03-18 22:16:13 +00:00
Mikio Hara
7a92b5139a ipv4: work around FreeBSD 12 kernel running COMPAT_FREEBSD32
On FreeBSD 12 kernel running COMPAT_FREEBSD32, it looks like the system
call recvmsg always returns an incorrect​ length for the out-of-band
data. This change adjusts the length when it looks incorrect.

Fixes golang/go#30899.

Change-Id: Ibb0cbcf9b1f5f959279c20395916d47bd75d289c
Reviewed-on: https://go-review.googlesource.com/c/net/+/168077
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-18 21:45:11 +00:00
Mikio Hara
784e4c8c97 ipv4: drop support for go1.8 or below
Change-Id: I27e30dbb0cbbd5c3dd53333882a794f0ef1092ff
Reviewed-on: https://go-review.googlesource.com/c/net/+/162598
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
2019-03-10 07:45:25 +00:00
Mikio Hara
c0ac1a5574 ipv4: drop the use of syscall package in platform-independent code
Change-Id: I5a8eac6e80fd2c9f4604231d51cb91d3b8514fea
Reviewed-on: https://go-review.googlesource.com/121882
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-02 21:24:22 +00:00
Mikio Hara
f073e08683 Revert "ipv4: enable {Read,Write}Batch methods of {Packet,Raw}Conn on NetBSD"
This reverts commit eb818ae5e4.

Change-Id: I2034119c7a512c7ceffa72e837e4bed3ff01ed8d
Reviewed-on: https://go-review.googlesource.com/82696
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2017-12-07 22:19:59 +00:00
Mikio Hara
eb818ae5e4 ipv4: enable {Read,Write}Batch methods of {Packet,Raw}Conn on NetBSD
Change-Id: I21ec68eef6cf14e0ff30b437d717d46e1dc9fea5
Reviewed-on: https://go-review.googlesource.com/82456
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-07 21:46:33 +00:00
Mikio Hara
b7a1f62a47 ipv4: add {Read,Write}Batch methods to {Packet,Raw}Conn
This change provides message IO functionality that may support the
construction of modern datagram transport protocols.

The modern datagram transport protocols on a multihomed node basically
need to control each packet path for traffic engineering by using
information belongs to network- or link-layer implementation. In
addtion, it's desirable to be able to do simultaneous transmission
across multiple network- or link-layer adjacencies wihtout any
additional cost.

The ReadBatch and WriteBatch methods of PacketConn and RawConn can be
used to read and write an IO message that contains the information of
network- or link-layer implementation, and read and write a batch of
IO messages on Linux. The Marshal and Parse methods of ControlMessage
and Header can help to marshal and parse information contained in IO
messages.

Updates golang/go#3661.

Change-Id: Ia84a9d3bc51641406eaaf4258f2a3066945cc323
Reviewed-on: https://go-review.googlesource.com/38275
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-27 06:01:44 +00:00