PR_ntohll and PR_htonll dumbly swap bytes.

RESOLVED FIXED

Status

NSPR
NSPR
P3
normal
RESOLVED FIXED
19 years ago
19 years ago

People

(Reporter: Wan-Teh Chang, Assigned: Wan-Teh Chang)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

19 years ago
This bug is reported by Doug Turner (dougt@netscape.com)
in netscape.public.mozilla.nspr:
    Currently they are dumbly swapping.  could these check
    to see if the bytes to need to be rearranged and if
    they do not, just no-op?
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

19 years ago
I added a new test nsprpub/pr/tests/ntoh.c for
PR_ntohs, PR_ntohl, PR_ntohll, PR_htons, PR_htonl,
and PR_htonll on the NSPRPUB_RELEASE_4_0_BRANCH.
(Assignee)

Comment 2

19 years ago
Created attachment 5354 [details] [diff] [review]
Proposed fix for PR_htonll and PR_ntohll.
(Assignee)

Comment 3

19 years ago
Turns out that PR_htonll and PR_ntohll not only
dumbly swap bytes but also swap bytes incorrectly.
The 'lo' and 'hi' halves should also be swapped.
(Assignee)

Comment 4

19 years ago
I checked in the fix on NSPRPUB_RELEASE_4_0_BRANCH.
/cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c, revision 3.11.4.16
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.