Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/unix: add support for L2TPIP sockaddr on Linux #37787

Closed
tomparkin opened this issue Mar 10, 2020 · 6 comments
Closed

x/sys/unix: add support for L2TPIP sockaddr on Linux #37787

tomparkin opened this issue Mar 10, 2020 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@tomparkin
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.13.7 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tom/.cache/go-build"
GOENV="/home/tom/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/tom/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build096416278=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Linux kernel supports L2TPv3 (RFC3931) IP-encapsulated tunnels using two special sockaddr structures which include the L2TP control connection ID. These structures "struct sockaddr_l2tpip" and "struct sockaddr_l2tpip6" are not currently represented in x/sys/unix, meaning that Go programs cannot conveniently create L2TPv3 IP encapsulated tunnels.

The unix package should be extended to include types for the L2TPIP-specific sockaddr structures.

@gopherbot gopherbot added this to the Unreleased milestone Mar 10, 2020
@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 11, 2020
@toothrot
Copy link
Contributor

/cc @ianlancetaylor @bradfitz @tklauser

@tomparkin
Copy link
Author

I have been working on code to implement this support, current version here:

tomparkin/sys@ec1d125

This is still work-in-progress. Although I have unit tested my changes I'd like to test them further.

@tklauser
Copy link
Member

@tomparkin Feel free to send a CL/PR once you have a version ready for review.

@tomparkin
Copy link
Author

PR here: golang/sys#60

I'm not sure how to automatically associate the PR with this issue :-(

@tklauser
Copy link
Member

PR here: golang/sys#60

I'm not sure how to automatically associate the PR with this issue :-(

Just add Fixes golang/go#37787 in the PR description.

tomparkin added a commit to tomparkin/sys that referenced this issue Mar 12, 2020
Creating an IPPROTO_L2TP socket requires that the kernel's l2tp_ip or
l2tp_ip6 module is loaded.  If these modules are not running, the
socket call will return with error code EPROTONOSUPPORT.

To allow tests to run without the L2TP modules loaded, skip tests
where the unix.Socket() call returns EPROTONOSUPPORT.

Fixes golang/go#37787
@gopherbot
Copy link

Change https://golang.org/cl/223157 mentions this issue: unix: implement L2TPIP socket address on Linux

@golang golang locked and limited conversation to collaborators Mar 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants