Skip to content

Port number truncated in warning messages in log if port number 5 digits long #2408

@rrobgill

Description

@rrobgill

Versions

  • FTL: 6.1
    (also present in FTL dev)

Expected behavior

Log file to report true port number in case of a connection error
eg WARNING Connection error (127.0.0.1#55335): TCP connection failed (Connection refused)

Actual behavior / bug

Final digit of port number is truncated if port number is 5 digits long
eg WARNING Connection error (127.0.0.1#5535): TCP connection failed (Connection refused)

Steps to reproduce

Trigger an ntp upstream error on a dns query when the upstream server has a port ≥ 10,000
(eg, set upstream to a non-listening port ≥ 10,000 and force an ntp query via dig +ntp domain.tld @pi.hole)

Additional context

Reported on discourse https://discourse.pi-hole.net/t/wrong-port-in-log-message/78675 and previously linked within that post.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions