From 21481a3c52acd269366cd242c56e84a44c19b685 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 24 Aug 2023 12:03:08 +0200 Subject: [PATCH] net: remove unused ipv4AddrToInterface It's unused since CL 6497044. Change-Id: Iee07e7af7b80fc3f00146b64cebead844daee087 Reviewed-on: https://go-review.googlesource.com/c/go/+/522196 Run-TryBot: Tobias Klauser TryBot-Result: Gopher Robot Auto-Submit: Tobias Klauser Reviewed-by: Bryan Mills Reviewed-by: Ian Lance Taylor --- src/net/sockopt_posix.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/net/sockopt_posix.go b/src/net/sockopt_posix.go index 32e8fcd5055..a380c7719b4 100644 --- a/src/net/sockopt_posix.go +++ b/src/net/sockopt_posix.go @@ -20,35 +20,6 @@ func boolint(b bool) int { return 0 } -func ipv4AddrToInterface(ip IP) (*Interface, error) { - ift, err := Interfaces() - if err != nil { - return nil, err - } - for _, ifi := range ift { - ifat, err := ifi.Addrs() - if err != nil { - return nil, err - } - for _, ifa := range ifat { - switch v := ifa.(type) { - case *IPAddr: - if ip.Equal(v.IP) { - return &ifi, nil - } - case *IPNet: - if ip.Equal(v.IP) { - return &ifi, nil - } - } - } - } - if ip.Equal(IPv4zero) { - return nil, nil - } - return nil, errNoSuchInterface -} - func interfaceToIPv4Addr(ifi *Interface) (IP, error) { if ifi == nil { return IPv4zero, nil