update to latest adns, synced with Go's net

This commit is contained in:
Mechiel Lukkien
2024-03-08 15:31:54 +01:00
parent a00b0ba6cd
commit 4fbd7abb57
17 changed files with 187 additions and 85 deletions

View File

@ -7,10 +7,12 @@ package adns
import (
"context"
"net"
"github.com/mjl-/adns/internal/bytealg"
)
func parseNetwork(ctx context.Context, network string, needsProto bool) (afnet string, proto int, err error) {
i := last(network, ':')
i := bytealg.LastIndexByteString(network, ':')
if i < 0 { // no colon
switch network {
case "tcp", "tcp4", "tcp6":