Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/adrg/xdg v0.5.3
github.com/alphadose/haxmap v1.4.1
github.com/anatol/vmtest v0.0.0-20250318022921-2f32244e2f0f
github.com/apoxy-dev/icx v0.11.0
github.com/apoxy-dev/icx v0.12.1
github.com/avast/retry-go/v4 v4.6.1
github.com/bramvdbogaerde/go-scp v1.5.0
github.com/buraksezer/olric v0.5.6
Expand All @@ -20,7 +20,7 @@ require (
github.com/dgraph-io/badger/v4 v4.5.0
github.com/docker/docker v28.2.2+incompatible
github.com/dpeckett/contextio v0.5.1
github.com/dpeckett/network v0.3.4
github.com/dpeckett/network v0.5.0
github.com/envoyproxy/gateway v0.5.0-rc.1.0.20240618131507-bdff5d56b59d
github.com/envoyproxy/go-control-plane v0.13.4
github.com/envoyproxy/go-control-plane/contrib v1.32.4
Expand Down Expand Up @@ -168,7 +168,6 @@ require (
github.com/docker/cli v24.0.6+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/dpeckett/triemap v0.3.1 // indirect
github.com/dunglas/httpsfv v1.0.2 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ github.com/apoxy-dev/apiserver-runtime v0.0.0-20250420214109-979c605051d1 h1:sAS
github.com/apoxy-dev/apiserver-runtime v0.0.0-20250420214109-979c605051d1/go.mod h1:zOVeivsnCWenmbgr6kiefIExoqlbuv2xyg9SXXfbs5U=
github.com/apoxy-dev/connect-ip-go v0.0.0-20250530062404-603929a73f45 h1:SwPk1n/oSVX7YwlNpC9KNH9YaYkcL/k6OfqSGVnxyyI=
github.com/apoxy-dev/connect-ip-go v0.0.0-20250530062404-603929a73f45/go.mod h1:z5rtgIizc+/K27UtB0occwZgqg/mz3IqgyUJW8aubbI=
github.com/apoxy-dev/icx v0.11.0 h1:/HFcCoPHyjBp2/+wZ09BM3hyQ4zh8mdIe/4CG61JWQk=
github.com/apoxy-dev/icx v0.11.0/go.mod h1:Muuk3bRXTp3YB5Xj+xHOGQ/T1xVxIKJuvmMfLBXhIN4=
github.com/apoxy-dev/icx v0.12.1 h1:VaczJSdujpsO8NjS0RvxiF55fco+iKZyurcZu4ddeP8=
github.com/apoxy-dev/icx v0.12.1/go.mod h1:QNPhLVUVbbSVSyERjmgGN4K8vzSC6bvZlN0tyflYf0U=
github.com/apoxy-dev/quic-go v0.0.0-20250530165952-53cca597715e h1:10GIpiVyKoRgCyr0J2TvJtdn17bsFHN+ROWkeVJpcOU=
github.com/apoxy-dev/quic-go v0.0.0-20250530165952-53cca597715e/go.mod h1:MFlGGpcpJqRAfmYi6NC2cptDPSxRWTOGNuP4wqrWmzQ=
github.com/apoxy-dev/upgrade-cli v0.0.0-20240213232412-a56c3a52fa0e h1:FBNxMQD93z2ththupB/BYKLEaMWaEr+G+sJWJqU2wC4=
Expand Down Expand Up @@ -309,10 +309,8 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dpeckett/contextio v0.5.1 h1:w19s6EThbZuRpa2z/Lu06v6+o3rrZhbBzmkol6en/hA=
github.com/dpeckett/contextio v0.5.1/go.mod h1:IY/CQ1ee6y4C5j/mU0X0M/D84s2FxNisggbNClTPndc=
github.com/dpeckett/network v0.3.4 h1:zOa5hIjOKtl13+FGde6Av4VrD+PmD03AadMKYrhkoOg=
github.com/dpeckett/network v0.3.4/go.mod h1:AyOdc+YGAT7zWoDDd/r8Pv4kGNlKrboVcug0FKaoqbA=
github.com/dpeckett/triemap v0.3.1 h1:jzxCyKs/ATw9uCdD2bd0xFTPLIP9uZwX0iZUOOOIDoc=
github.com/dpeckett/triemap v0.3.1/go.mod h1:pBxNH+K6m5I4lVo+W7u6JEanxP13adD4t2XYVMxfmTo=
github.com/dpeckett/network v0.5.0 h1:aGNcUG5LIULxxHz2r6s+FkY2iDkSV+MA3YiNE6J9aJg=
github.com/dpeckett/network v0.5.0/go.mod h1:QhgAxfIFDcsVrQ5AqDUY403TGwZhexm7bHf1ZldXV1I=
github.com/dunglas/httpsfv v1.0.2 h1:iERDp/YAfnojSDJ7PW3dj1AReJz4MrwbECSSE59JWL0=
github.com/dunglas/httpsfv v1.0.2/go.mod h1:zID2mqw9mFsnt7YC3vYQ9/cjq30q41W+1AnDwH8TiMg=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
Expand Down
2 changes: 1 addition & 1 deletion pkg/netstack/icx_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (net *ICXNetwork) Start() error {
phyFrame := net.pktPool.Get().(*[]byte)
*phyFrame = (*phyFrame)[:cap(*phyFrame)]

if n := net.handler.ScheduledToPhy(*phyFrame); n > 0 {
if n := net.handler.ToPhy(*phyFrame); n > 0 {
if err := net.phy.WriteFrame((*phyFrame)[:n]); err != nil {
net.pktPool.Put(phyFrame)
return fmt.Errorf("writing scheduled phy frame failed: %w", err)
Expand Down
6 changes: 3 additions & 3 deletions pkg/tunnel/l2pc/l2pc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var ErrInvalidFrame = errors.New("invalid frame")
// L2PacketConn adapts a net.PacketConn (UDP) to read/write L2 Ethernet frames.
type L2PacketConn struct {
pc net.PacketConn
localAddrs addrselect.AddressList
localAddrs addrselect.List
localMAC tcpip.LinkAddress
peerMACCache sync.Map
pktPool sync.Pool
Expand Down Expand Up @@ -51,7 +51,7 @@ func NewL2PacketConn(pc net.PacketConn) (*L2PacketConn, error) {
// Random locally-administered unicast MAC for "our" link address.
localMAC := tcpip.GetRandMacAddr()

var localAddrs addrselect.AddressList
var localAddrs addrselect.List
for _, ap := range localAddrPorts {
la := &tcpip.FullAddress{
Addr: func() tcpip.Address {
Expand Down Expand Up @@ -165,7 +165,7 @@ func (c *L2PacketConn) ReadFrame(dst []byte) (int, error) {
// Build addresses for udp.Encode (note: for an inbound frame,
// src = remote, dst = local).
srcFA := toFullAddr(remote)
dstFA := c.localAddrs.Pick(srcFA)
dstFA := c.localAddrs.Select(srcFA)

// Random-but-stable (per remote IP) src MAC.
srcFA.LinkAddr = c.peerMACForIP(remote.IP)
Expand Down
6 changes: 3 additions & 3 deletions pkg/tunnel/router/icx_netlink_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type ICXNetlinkRouter struct {
pcapFile *os.File
tun *tunnel.Tunnel
iptV4, iptV6 utiliptables.Interface
extAddrs addrselect.AddressList
extAddrs addrselect.List
closeOnce sync.Once
}

Expand Down Expand Up @@ -164,7 +164,7 @@ func NewICXNetlinkRouter(opts ...Option) (*ICXNetlinkRouter, error) {
return nil, fmt.Errorf("failed to create tunnel: %w", err)
}

var extAddrsList addrselect.AddressList
var extAddrsList addrselect.List
for _, addr := range extAddrs {
extAddrsList = append(extAddrsList, netstack.ToFullAddress(netip.MustParseAddrPort(addr.String())))
}
Expand Down Expand Up @@ -312,7 +312,7 @@ func (r *ICXNetlinkRouter) DelRoute(dst netip.Prefix) error {
func (r *ICXNetlinkRouter) ResolveMAC(ctx context.Context, peerAddr netip.AddrPort) (tcpip.LinkAddress, error) {
peerFullAddr := netstack.ToFullAddress(peerAddr)

localFullAddr := r.extAddrs.Pick(peerFullAddr)
localFullAddr := r.extAddrs.Select(peerFullAddr)

slog.Debug("Resolving MAC address",
slog.String("local", localFullAddr.Addr.String()),
Expand Down