15 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
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
Dmitri Shuralyov
357296a763 all: single space after period
The tree's pretty inconsistent about single space vs double space
after a period in documentation. Make it consistently a single space,
per earlier decisions, and changes in go repository. This means
contributors won't be confused by misleading precedence.

This CL was generated with:

	perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')

on top of copyright headers change in https://golang.org/cl/32878.

Follows https://golang.org/cl/20022.

Change-Id: I821e4a300122b4668aa31e12eaa914db615e5369
Reviewed-on: https://go-review.googlesource.com/32879
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-01 21:02:21 +00:00
Mikio Hara
bb2257b551 ipv4: drop package name prefix from identifiers in docs for consistency
Change-Id: I00b3297b88142ddb3c0cd08391171ebb6e731550
Reviewed-on: https://go-review.googlesource.com/34751
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-06 00:50:49 +00:00
Mikio Hara
0cc888483f ipv4: add missing BUGS section
Change-Id: Idf0f3ce0cbd5eb402eb4929e4280b1bf746c04e9
Reviewed-on: https://go-review.googlesource.com/34432
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-12-15 08:38:04 +00:00
Dmitri Shuralyov
5d997795f7 all: make copyright headers consistent with one space after period
Go policy has been single space after periods in comments for some time.

The copyright header template at:

	https://golang.org/doc/contribute.html#copyright

also uses a single space.

Make them all consistent.

This CL was generated with:

	perl -i -npe 's,^(// Copyright [0-9]+ The Go Authors\.)  (All rights reserved\.)$,$1 $2,' $(git grep -l -E '^// Copyright [0-9]+ The Go Authors\.  All rights reserved\.$')

Follows https://golang.org/cl/20111.

Change-Id: I66671dddf821f5dc027bc254e0196b3e3a2bdf3b
Reviewed-on: https://go-review.googlesource.com/32878
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-07 23:52:11 +00: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
Mikio Hara
867c418fdf go.net/ipv4: fix typo
R=dave
CC=golang-dev
https://golang.org/cl/27420043
2013-11-17 12:48:08 +09:00
Mikio Hara
b38392a462 go.net/ipv4: simplify, drop unnecessary parentheses and slice indices
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7300102
2013-02-14 07:01:07 +09:00
Mikio Hara
0e4f6eb3bd go.net/ipv4: change I/O method signatures on PacketConn and RawConn
Preserves both Read and Write signatures for the future usage.

R=dave, rsc
CC=golang-dev
https://golang.org/cl/6970048
2012-12-21 07:30:42 +09:00
Mikio Hara
d2e5a1215d go.net/ipv4: new package
Package ipv4 implements IP-level socket options for the Internet
Protocol version 4. It also provides raw IP socket access methods
including IPv4 header manipulation.

Fixes golang/go#3684.
Fixes golang/go#3820.

This CL requires CL 6426047;
net: add read, write message methods to IPConn, UDPConn

R=rsc, dave, alex.brainman
CC=gobot, golang-dev
https://golang.org/cl/6482044
2012-09-26 21:03:09 +09:00