#1099414 IP address shown incorrectly on connect failure

Package:
trn4
Source:
trn4
Submitter:
Paul Slootman
Date:
2025-03-03 11:15:02 UTC
Severity:
normal
Tags:
#1099414#5
Date:
2025-03-03 10:58:12 UTC
From:
To:
news.eternal-september.org is currently down. The error shown is:

Connecting to news.eternal-september.org...connection to 2.0.0.119: Connection refused
trying a00:77::2a01:4f9:4b:44c2...connection to a00:77::2a01:4f9:4b:44c2: Network is unreachable
giving up... connect: Network is unreachable
failed.

However, the IP addresses for news.eternal-september.org are:

$ host news.eternal-september.org
news.eternal-september.org has address 135.181.20.170
news.eternal-september.org has IPv6 address 2a01:4f9:4b:44c2::2

The inet_ntop() function is not passed the correct address.
The attached patch fixes this (and a minor compiler warning about
"possible use before initialization").


Thanks,
Paul