Skip to content

Newt UDP hole punching does not parse ipv6 port correctly #126

@kevin-gillet

Description

@kevin-gillet

Newt version 1.4.4 seems to parse port for hole punching based on what is after the first colon, but this way of working is incompatible with ipv6 because the ipv6 adress is written with multiple colons.

Newt is installed as a systemd service on a debian12-lxc-amd64 container.

root@newt-debian12-lxc-amd64:~# systemctl status newt --no-pager -l
● newt.service - Newt
     Loaded: loaded (/etc/systemd/system/newt.service; enabled; preset: enabled)
     Active: active (running) since Thu 2025-09-04 01:08:47 UTC; 1min 10s ago
 Invocation: 2c220ee5295b4579b7195e664bde8be1
   Main PID: 12761 (newt)
      Tasks: 7 (limit: 76567)
     Memory: 15.4M (peak: 15.9M)
        CPU: 46ms
     CGroup: /system.slice/newt.service
             └─12761 /root/.local/bin/newt --id <redacted> --secret <redacted> --endpoint <redacted> --accept-clients --native

Sep 04 01:09:33 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:33 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
Sep 04 01:09:36 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:36 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
Sep 04 01:09:38 newt-dc03 newt[12761]: INFO: 2025/09/04 01:09:38 Failed to report peer bandwidth: failed to calculate peer bandwidth: failed to get device: file does not exist
Sep 04 01:09:39 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:39 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
Sep 04 01:09:42 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:42 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
Sep 04 01:09:45 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:45 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
Sep 04 01:09:48 newt-dc03 newt[12761]: INFO: 2025/09/04 01:09:48 Failed to report peer bandwidth: failed to calculate peer bandwidth: failed to get device: file does not exist
Sep 04 01:09:48 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:48 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
Sep 04 01:09:51 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:51 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
Sep 04 01:09:54 newt-dc03 newt[12761]: ERROR: 2025/09/04 01:09:54 Failed to send UDP hole punch: failed to parse server port: strconv.ParseUint: parsing "cf06": invalid syntax
root@newt-dc03:~# nslookup <redacted>
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   <redacted>
Address: xxxx:cf06:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx

Here it is parsing "cf06" as the port but it is part of the ipv6 adress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions