Closed Bug 864039 Opened 12 years ago Closed 2 years ago

PR_INADDR_ANY needs PR_htonl before assignment to inet.ip

Categories

(NSS :: Tools, defect, P5)

x86_64
Linux

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: woutershep, Assigned: KaiE)

Details

Attachments

(2 files)

Attached patch use PR_htonlSplinter Review
https://developer.mozilla.org/en/docs/PRNetAddr states: The macros PR_AF_INET, PR_AF_INET6, PR_INADDR_ANY, PR_INADDR_LOOPBACK are defined if prio.h is included. PR_INADDR_ANY and PR_INADDR_LOOPBACK are special IPv4 addresses in host byte order, so they must be converted to network byte order before being assigned to the inet.ip field. Attached is a patch against 1.14.3 to do just that.
Severity: normal → S3
Severity: S3 → S4
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Priority: -- → P5
Resolution: --- → INACTIVE

Hey! After 11 years, who would've thought!

Unfortunately i do not see any change in the source code.
https://hg.mozilla.org/projects/nss/file/tip/cmd/httpserv/httpserv.c#l975

Was this mistakenly marked resolved or just not pushed yet or something?

Documentation seems to have been relocated meanwhile but still seems to say the same as it did 11 years ago:

"The macros PR_AF_INET, PR_AF_INET6, PR_INADDR_ANY, PR_INADDR_LOOPBACK are defined if prio.h is included. PR_INADDR_ANY and PR_INADDR_LOOPBACK are special IPv4 addresses in host byte order, so they must be converted to network byte order before being assigned to the inet.ip field." - https://firefox-source-docs.mozilla.org/nspr/reference/prnetaddr.html#description

Flags: needinfo?(bbeurdouche)

@Kai, I closed this inactive but it is not. Actually this seems like an NSPR issue. Can you please retriage this ? : ) Thanks!

Assignee: nobody → nobody
Status: RESOLVED → REOPENED
Component: Libraries → NSPR
Ever confirmed: true
Flags: needinfo?(bbeurdouche) → needinfo?(kaie)
Product: NSS → NSPR
Resolution: INACTIVE → ---
Target Milestone: --- → Future
Version: 3.14.3 → other

Actually, it's an issue with the NSS tools.

Assignee: nobody → nobody
Component: NSPR → Tools
Flags: needinfo?(kaie)
Product: NSPR → NSS

Wouter, thank you. I agree with you. All over the NSPR code I see that PR_INADDR_ANY is used in the way you suggest.

Attached patch 864039.patchSplinter Review

This is just merged and has proper author and commit message.

Assignee: nobody → kaie
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: