Files
Alexander CuevaandgVisor bot 73d7c6742b Implement Nftables DELTABLE, DESTROYTABLE message functionality
These messages now allow us to delete tables by name or by handle,
and flush tables under certain scenarios. Also updated the nftables
package to create a translation between nftables flags (NFPROTO_INET, etc)
to regular address families. This "translation" in Linux is done implicitly
by setting these enums to overlapping values, but here it is done explicitly
because stack.AFs are of custom type AF. This gives us an extra safety check
on allowing only supported family addresses.

Finally, updated tests to dynamically create requests with buffers.
This was needed so that the correct amount of padding is inserted
between headers and payloads.

PiperOrigin-RevId: 783444579
2025-07-15 13:12:47 -07:00

40 lines
728 B
Python

load("//tools:defs.bzl", "go_library", "go_test")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_library(
name = "nlmsg",
srcs = [
"message.go",
],
visibility = [
"//pkg/sentry:internal",
"//pkg/tcpip/nftables:__subpackages__",
],
deps = [
"//pkg/abi/linux",
"//pkg/bits",
"//pkg/hostarch",
"//pkg/log",
"//pkg/marshal",
"//pkg/marshal/primitive",
],
)
go_test(
name = "nlmsg_test",
size = "small",
srcs = [
"message_test.go",
],
deps = [
":nlmsg",
"//pkg/abi/linux",
"//pkg/marshal",
"//pkg/marshal/primitive",
],
)