Closed Bug 161610 Opened 23 years ago Closed 21 years ago

testclnt doesn't accept IPv6 format addresses

Categories

(NSS :: Tools, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nelson, Assigned: nelson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

tstclnt's -h option will allow you to enter a DNS hostname or an IPv4 format dotted-decimal IP address, but it does not accept an IPv6 format IP address, e.g. of the form ::ffff:1.2.3.4 or ::ffff:0102:0304 This means that tstclnt cannot be used to test IPv6 IP addresses with Subject Alternative Names in SSL server certs. Patch forthcoming.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 3.6
Attached patch proposed patch (obsolete) — Splinter Review
This patch switches from using PR_GetHostByName to using PR_StringToNetAddr and PR_GetIPNodeByName. Then, on platforms that don't actually support IPv6 addresses, it converts back to IPv4. This works on Win2k. But, I'm not sure that the test #if !defined(_PR_INET6) is correct to detect all platforms that don't support IPv6. Review invited.
Mass retarget all my old NSS bugs that were previous targeted at NSS versions that have now been released.
Target Milestone: 3.6 → 3.7
Moved to target milestone 3.8 because the original NSS 3.7 release has been renamed 3.8.
Target Milestone: 3.7 → 3.8
Remove target milestone of 3.8, since these bugs didn't get into that release.
Target Milestone: 3.8 → ---
Comment on attachment 94428 [details] [diff] [review] proposed patch I gave Nelson some suggested changes for this patch. The upcoming NSPR 4.5 release will have a new function PR_GetAddrInfoByName, which replaces the deprecated function PR_GetIPNodeByName. We should open a bug to remind us to switch to PR_GetAddrInfoByName when NSPR 4.5 is released.
Let's try to get this done in NSS 3.9. The current patch is already very close.
Target Milestone: --- → 3.9
This patch uses PR_IsNetAddrType and PR_NetAddrToString. These changes were suggested by Wan-Teh.
Attachment #94428 - Attachment is obsolete: true
Attachment #132564 - Flags: superreview?(wchang0222)
Comment on attachment 132564 [details] [diff] [review] patch v2 - using more NSPR funcs r=wtc. Two suggested changes for the printHostNameAndAddr function. 1. You can use the PR_NetAddrInetPort macro (defined in "prnetdb.h") to get the port number from a PRNetAddr. 2. To print 'port' (a PRUint16), it seems that %hu (for unsigned short) would be a better format specifier than %d (for int).
Attachment #132564 - Flags: superreview?(wchang0222) → superreview+
I applied Wan-teh's suggestions and checked it in. /cvsroot/mozilla/security/nss/cmd/tstclnt/tstclnt.c,v <-- tstclnt.c new revision: 1.34; previous revision: 1.33
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Depends on: 366614
Blocks: 366614
No longer depends on: 366614
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: