summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/nested/BUILD
diff options
context:
space:
mode:
authorBruno Dal Bo <brunodalbo@google.com>2020-06-22 10:30:21 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-22 10:31:45 -0700
commit282a6aea1b375d447fdf502c6660e92eb5e19cd4 (patch)
tree3c90df2c74369144427c289b3e3b320956e7b52d /pkg/tcpip/link/nested/BUILD
parenta480b4faf4befb029bf905fdb604996c8312a6a2 (diff)
Extract common nested LinkEndpoint pattern
... and unify logic for detached netsted endpoints. sniffer.go caused crashes if a packet delivery is attempted when the dispatcher is nil. Extracted the endpoint nesting logic into a common composable type so it can be used by the Fuchsia Netstack (the pattern is widespread there). PiperOrigin-RevId: 317682842
Diffstat (limited to 'pkg/tcpip/link/nested/BUILD')
-rw-r--r--pkg/tcpip/link/nested/BUILD31
1 files changed, 31 insertions, 0 deletions
diff --git a/pkg/tcpip/link/nested/BUILD b/pkg/tcpip/link/nested/BUILD
new file mode 100644
index 000000000..bdd5276ad
--- /dev/null
+++ b/pkg/tcpip/link/nested/BUILD
@@ -0,0 +1,31 @@
+load("//tools:defs.bzl", "go_library", "go_test")
+
+package(licenses = ["notice"])
+
+go_library(
+ name = "nested",
+ srcs = [
+ "nested.go",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//pkg/sync",
+ "//pkg/tcpip",
+ "//pkg/tcpip/buffer",
+ "//pkg/tcpip/stack",
+ ],
+)
+
+go_test(
+ name = "nested_test",
+ size = "small",
+ srcs = [
+ "nested_test.go",
+ ],
+ deps = [
+ "//pkg/tcpip",
+ "//pkg/tcpip/header",
+ "//pkg/tcpip/link/nested",
+ "//pkg/tcpip/stack",
+ ],
+)