automated "fork" of gVisor that only contains the netstack bits so the go.mod is smaller. maintained by scripts, not humans.

Overview

netstack

This is a "fork" of https://github.com/google/gvisor, extracting out just the "netstack" networking bits, which previously were self-contained at https://github.com/google/netstack.

Why?

Because gVisor's go.mod is gigantic and causes problems to people trying to use it as a library.

Arguably Go's tooling is also somewhat to blame: Go doesn't make it easy (or even possible) to use a subset (a few packages) out of a mega module like gVisor without getting impacted by otherwise-unrelated requirements of that dependent module.

Specifically, Tailscale wanted to use gVisor's tcpip networking packages, which worked fine for a while, but then one day we bumped our gVisor version to pull in a bug fix we needed (from the networking-related part of gVisor), and that ended up making us pull in new conflicting versions of etcd. Why? Because somewhere in that go.mod Docker or grpc or Kubernetes or whatever depended on etcd somehow. Who knows. We spent too long trying to fix it and gave up.

Our fix is this repo, pulling netstack out of gvisor like it used to be, with a small go.mod.

Contributing

We don't accept contributions. This repo isn't human-maintained. It's synced from gVisor's "go" branch. In fact, the flow looks like:

  • humans maintain gVisor inside Google's internal monorepo (let's call it googletree)
  • some scripts inside Google export //googletree/gvisor/... out into GitHub occasionally
  • oh, but googletree uses Bazel, not the cmd/go Go tool
  • so some other scripts rearrange the GitHub repo into the gVisor "go" branch (https://github.com/google/gvisor/#using-go-get)
  • some of our scripts then take that "go" rearrangement tree and delete all the Linux and Docker and container stuff, leaving behind only the networking stuff

License

Same as gVisor.

You might also like...
A simple multi-layered config loader for Go. Made for smaller projects. No external dependencies.

config ⚠️ Work in progress! A simple multi-layered config loader for Go. Made for smaller projects. No external dependencies. Installation go get -u g

This repository contains utility functions that do not make sense in other packages.

Installation go get github.com/IQ-tech/go-utils Executing code before process exits AtInterruption receives a function that will be called once befor

This is old and unmaintained code, ignore it. starfish is a simple, SDL based, 2D graphics and user input library for Go. If you intend to work on it, please fork from the 'devel' branch, not 'master'. Current release: 0.12.0

What is starfish? What starfish is: starfish is a simple 2D graphics and user input library for Go built on SDL. What starfish is not: While it is bui

Distributed lock manager. Warning: very hard to use it properly. Not because it's broken, but because distributed systems are hard. If in doubt, do not use this.

What Dlock is a distributed lock manager [1]. It is designed after flock utility but for multiple machines. When client disconnects, all his locks are

Coral, a friendly Cobra fork with nearly all its features, but only 4 dependencies
Coral, a friendly Cobra fork with nearly all its features, but only 4 dependencies

Coral Preamble I love Cobra and I love Viper. They are great projects, incredibly useful and outstandingly important for the Go community. But sometim

General Pod Autoscaler(GPA) is a extension for K8s HPA, which can be used not only for serving, also for game.
General Pod Autoscaler(GPA) is a extension for K8s HPA, which can be used not only for serving, also for game.

Introduction General Pod Autoscaler(GPA) is a extension for K8s HPA, which can be used not only for serving, also for game. Features Compatible with a

copy files for humans

Go-Decent-Copy go-decent-copy provides a copy file for humans Usage package main import "github.com/hugocarreira/go-decent-copy" func main() { e

Go Humans! (formatters for units to human friendly sizes)

Humane Units Just a few functions for helping humanize times and sizes. go get it as github.com/dustin/go-humanize, import it as "github.com/dustin/go

Golang beautify data display for Humans

Golang beautify data display for Humans English 简体中文 Install # Stable version go get -u -v gopkg.in/ffmt.v1 # Latest version go get -u -v github.com/

Go Humans! (formatters for units to human friendly sizes)

Humane Units Just a few functions for helping humanize times and sizes. go get it as github.com/dustin/go-humanize, import it as "github.com/dustin/go

🐶 Command-line DNS Client for Humans. Written in Golang
🐶 Command-line DNS Client for Humans. Written in Golang

doggo 🐶 Command-line DNS client for humans doggo is a modern command-line DNS client (like dig) written in Golang. It outputs information in a neat c

Golang beautify data display for Humans

Golang beautify data display for Humans English 简体中文 Usage Examples package main import ( ffmt "gopkg.in/ffmt.v1" ) func main() { example() } typ

HuJSON: JSON for Humans (comments and trailing commas)

HuJSON - Human JSON The HuJSON decoder is a JSON decoder that also allows comments, both /* ... */ and // to end of line trailing commas on arrays and

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.

gotestsum gotestsum runs tests using go test --json, prints formatted test output, and a summary of the test run. It is designed to work well for both

Surprisingly space efficient trie in Golang(11 bits/key; 100 ns/get).
Surprisingly space efficient trie in Golang(11 bits/key; 100 ns/get).

Slim - surprisingly space efficient data types in Golang Slim is collection of surprisingly space efficient data types, with corresponding serializati

Program that counts the bits in an unsigned integer

popcountloop This is an exercise of the book The Go Programming Language, by Ala

Shuffle bits in byte slice, written in golang

Shuffle 'em It is a library for bit shuffling, written in golang. The usecases a

Kiteco-public - Primary Kite repo — private bits replaced with XXXXXXX

This is a public version of the main Kite repo The main Kite repo (originally kiteco/kiteco) was intended for private use. It has been lightly adapted

It's a basic newtonian gravity simulation written in Go using floating point numbers with 1024 bits of accuracy

Float 1K Gravity What is it? It's a basic newtonian gravity simulation written in Go using floating point numbers with 1024 bits of accuracy. It is cu

Comments
  • Question about deprecation

    Question about deprecation

    As of 7585b01ddccf285fc598761f6ce4bd4dd0ee24ee this repository seems to claim it is no longer required, in favour of using the tcpip package from github.com/google/gvisor or gvisor.dev/gvisor directly (claiming that Go 1.17 fixes the lazy loading at least). However, I have been completely unable to move across to upstream.

    Trying to substitute the inet.af/netstack/tcpip imports in my own project with gvisor.dev/gvisor/pkg/tcpip results in catastrophic build errors on seemingly all recent commits. Dozens of issues — go mod tidy fails for various reasons, go test ./... reports build errors and my own application fails to build too. I've tried this with various recent commits, including with the release-20211115.0 tag that this repository seemed to last import. Trying this on a Linux machine instead of a Mac produces some different results but still unusable. Both with Go 1.17.

    However, release-20211115.0 of inet.af/netstack works perfectly, even on macOS.

    With that in mind, is this repository really no longer required? It seems like upstream is totally unusable somehow, and yet none of these issues manifest with inet.af/netstack — this fork works flawlessly. It seems like this repository still very much solves a problem in making netstack usable in isolation.

    Am I missing something obvious here?

    opened by neilalexander 2
  • add a go.mod file

    add a go.mod file

    I realise that this library is still usable without being a module directly, but I imagine there's no reason to avoid adding a go.mod file either?

    One good reason to add a go.mod file is that one can use commands like go build, go list, and so on. Another is UX: it's not entirely clear that I'm meant to import this as inet.af/netstack rather than github.com/inetaf/netstack if I don't see a go.mod saying as much.

    opened by mvdan 4
  • Please upgrade upsteam gvisor version (after memory leak fix)

    Please upgrade upsteam gvisor version (after memory leak fix)

    ~~Upstream fix a memory leak problem on Fix PacketBuffer memory leak.~~

    gVisor not fully resolved this memory leak, waiting for them to make a full fix

    Maybe this repository should be synced upstream?

    opened by Dreamacro 0
The go mod init command initializes and writes a new go.mod file in the current directory

go mod: The go mod init command initializes and writes a new go.mod file in the current directory, in effect creating a new module rooted at the curre

null 0 Nov 21, 2021
netcat using netstack userspace library

netkat netcat version using raw sockets to avoid iptables and/or other OS filtering mechanisms. Install make build Usage It requires root privileges:

Antonio Ojea 123 Dec 9, 2022
A fork of the simple WireGuard VPN server GUI community maintained

Subspace - A simple WireGuard VPN server GUI Subspace - A simple WireGuard VPN server GUI Slack Screenshots Features Contributing Setup 1. Get a serve

null 1.7k Dec 25, 2022
Reflectionless data binding for Go's net/http (not actively maintained)

binding Reflectionless data binding for Go's net/http Features HTTP request data binding Data validation (custom and built-in) Error handling Benefits

Matt Holt 793 Nov 18, 2022
✏️ CLI tool to split a file into smaller sub-files

filesplit CLI tool to split a file into smaller sub-files Build $ go build Usage filesplit [mode] [-F, --file] [-N, --number] Examples # Split foo.txt

Martin Sit 5 Apr 20, 2022
A tool to determine the highest version number that's smaller than a target version number

semver-highest A tool to determine the highest version number that's smaller than a target version number. Installation go install github.com/marten-s

Marten Seemann 1 Oct 13, 2021
Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

Patrick D'appollonio 204 Dec 29, 2022
Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

kubectl-slice: split Kubernetes YAMLs into files kubectl-slice is a neat tool that allows you to split a single multi-YAML Kubernetes manifest into mu

Patrick D'appollonio 205 Jan 3, 2023
A simple multi-layered config loader for Go. Made for smaller projects. No external dependencies.

gocfg ⚠️ Work in progress! A simple multi-layered config loader for Go. Made for smaller projects. No external dependencies. Example From main.go: //

Kai Dinghofer 2 Dec 26, 2021