From 2d92988ef3dc37be72af9138b67b718bf408577e Mon Sep 17 00:00:00 2001 From: Haiyan Meng Date: Sun, 13 Sep 2026 13:04:33 -0400 Subject: [PATCH] ateomnet: drop the unused PodIPv4 helper Nothing calls it, and its comment documents a design that is gone: it says the pod IP stays available for "the temporary inbound DNAT rule", but no DNAT rule exists anywhere in the tree. Inbound traffic reaches the actor through the atunnel ingress server, which proxies to the actor veth address, and InstallActorNftablesRules installs only REDIRECT, masquerade, and forward-accept. Leaving it in place costs a reader the time to work out which of the two descriptions of actor ingress is the current one. --- internal/ateomnet/net.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/internal/ateomnet/net.go b/internal/ateomnet/net.go index 91203a8e04..ce70294f23 100644 --- a/internal/ateomnet/net.go +++ b/internal/ateomnet/net.go @@ -168,30 +168,6 @@ func CleanupActorNetwork(ctx context.Context, interiorNetNS netns.NsHandle) erro return cleanupErr } -// PodIPv4 resolves the worker pod IPv4 address from the pod namespace's real eth0. -func PodIPv4() (net.IP, error) { - // Resolve the worker pod IPv4 address from the pod namespace's real eth0. - // Because eth0 now stays in the pod namespace, this IP remains available for - // both normal worker connectivity and the temporary inbound DNAT rule. - eth0Link, err := netlink.LinkByName("eth0") - if err != nil { - return nil, fmt.Errorf("while getting pod eth0: %w", err) - } - addrs, err := netlink.AddrList(eth0Link, netlink.FAMILY_V4) - if err != nil { - return nil, fmt.Errorf("while listing pod eth0 addresses: %w", err) - } - for _, addr := range addrs { - if addr.IP == nil { - continue - } - if ip := addr.IP.To4(); ip != nil { - return ip, nil - } - } - return nil, fmt.Errorf("pod eth0 has no IPv4 address") -} - // EnableIPv4Forwarding enables IPv4 forwarding in the current network namespace. func EnableIPv4Forwarding() error { // Forwarding is required because actor packets now enter the worker pod via