Merge remote-tracking branch 'origin/main' into dns-skip-failover-on-ede

# Conflicts:
#	client/internal/dns/upstream.go
This commit is contained in:
Viktor Liu
2026-05-07 12:16:04 +02:00
240 changed files with 11167 additions and 2951 deletions

View File

@@ -4,7 +4,9 @@ import (
"encoding/binary"
"fmt"
"io"
"net"
"net/netip"
"strconv"
"strings"
"time"
@@ -92,9 +94,9 @@ func (tw *TextWriter) writeTCP(timeStr string, dir Direction, info *packetInfo,
}
if !tw.verbose {
_, err := fmt.Fprintf(tw.w, "%s %s %s:%d > %s:%d [%s] length %d%s\n",
_, err := fmt.Fprintf(tw.w, "%s %s %s > %s [%s] length %d%s\n",
timeStr, tag(dir, "TCP"),
info.srcIP, info.srcPort, info.dstIP, info.dstPort,
net.JoinHostPort(info.srcIP.String(), strconv.Itoa(int(info.srcPort))), net.JoinHostPort(info.dstIP.String(), strconv.Itoa(int(info.dstPort))),
flags, plen, annotation)
if err != nil {
return err
@@ -126,9 +128,9 @@ func (tw *TextWriter) writeTCP(timeStr string, dir Direction, info *packetInfo,
verbose := tw.verboseIP(data, info.family)
_, err := fmt.Fprintf(tw.w, "%s %s %s:%d > %s:%d [%s]%s%s, win %d%s, length %d%s%s\n",
_, err := fmt.Fprintf(tw.w, "%s %s %s > %s [%s]%s%s, win %d%s, length %d%s%s\n",
timeStr, tag(dir, "TCP"),
info.srcIP, info.srcPort, info.dstIP, info.dstPort,
net.JoinHostPort(info.srcIP.String(), strconv.Itoa(int(info.srcPort))), net.JoinHostPort(info.dstIP.String(), strconv.Itoa(int(info.dstPort))),
flags, seqStr, ackStr, tcp.Window, opts, plen, annotation, verbose)
if err != nil {
return err
@@ -154,9 +156,9 @@ func (tw *TextWriter) writeUDP(timeStr string, dir Direction, info *packetInfo,
if tw.verbose {
verbose = tw.verboseIP(data, info.family)
}
_, err := fmt.Fprintf(tw.w, "%s %s %s:%d > %s:%d %s%s\n",
_, err := fmt.Fprintf(tw.w, "%s %s %s > %s %s%s\n",
timeStr, tag(dir, "UDP"),
info.srcIP, info.srcPort, info.dstIP, info.dstPort,
net.JoinHostPort(info.srcIP.String(), strconv.Itoa(int(info.srcPort))), net.JoinHostPort(info.dstIP.String(), strconv.Itoa(int(info.dstPort))),
s, verbose)
return err
}
@@ -166,9 +168,9 @@ func (tw *TextWriter) writeUDP(timeStr string, dir Direction, info *packetInfo,
if tw.verbose {
verbose = tw.verboseIP(data, info.family)
}
_, err := fmt.Fprintf(tw.w, "%s %s %s:%d > %s:%d length %d%s\n",
_, err := fmt.Fprintf(tw.w, "%s %s %s > %s length %d%s\n",
timeStr, tag(dir, "UDP"),
info.srcIP, info.srcPort, info.dstIP, info.dstPort,
net.JoinHostPort(info.srcIP.String(), strconv.Itoa(int(info.srcPort))), net.JoinHostPort(info.dstIP.String(), strconv.Itoa(int(info.dstPort))),
plen, verbose)
if err != nil {
return err
@@ -217,9 +219,9 @@ func (tw *TextWriter) writeICMPv6(timeStr string, dir Direction, info *packetInf
}
func (tw *TextWriter) writeFallback(timeStr string, dir Direction, proto string, info *packetInfo, data []byte) error {
_, err := fmt.Fprintf(tw.w, "%s %s %s:%d > %s:%d length %d\n",
_, err := fmt.Fprintf(tw.w, "%s %s %s > %s length %d\n",
timeStr, tag(dir, proto),
info.srcIP, info.srcPort, info.dstIP, info.dstPort,
net.JoinHostPort(info.srcIP.String(), strconv.Itoa(int(info.srcPort))), net.JoinHostPort(info.dstIP.String(), strconv.Itoa(int(info.dstPort))),
len(data)-info.hdrLen)
return err
}