diff options
author | James Tucker <james@tailscale.com> | 2023-04-18 22:29:55 -0700 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-06-27 17:48:32 +0200 |
commit | 25eb973e00d2a5d69456c4156daafb8db56e7e0a (patch) | |
tree | 9213fbb3c1f59cafdad6c87ff2790fe43e94a362 /conn/sticky_default.go | |
parent | b7cd547315bed421a648d0a0f1ee5a0fc1b1151e (diff) |
conn: store IP_PKTINFO cmsg in StdNetendpoint src
Replace the src storage inside StdNetEndpoint with a copy of the raw
control message buffer, to reduce allocation and perform less work on a
per-packet basis.
Signed-off-by: James Tucker <james@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conn/sticky_default.go')
-rw-r--r-- | conn/sticky_default.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/conn/sticky_default.go b/conn/sticky_default.go index 05f00ea..1fa8a0c 100644 --- a/conn/sticky_default.go +++ b/conn/sticky_default.go @@ -7,6 +7,20 @@ package conn +import "net/netip" + +func (e *StdNetEndpoint) SrcIP() netip.Addr { + return netip.Addr{} +} + +func (e *StdNetEndpoint) SrcIfidx() int32 { + return 0 +} + +func (e *StdNetEndpoint) SrcToString() string { + return "" +} + // TODO: macOS, FreeBSD and other BSDs likely do support this feature set, but // use alternatively named flags and need ports and require testing. |