[Bug 295434] libalias' _RandomPort() should use htons() instead of ntohs()
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 295434] libalias' _RandomPort() should use htons() instead of ntohs()"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 295434] libalias' _RandomPort() should use htons() instead of ntohs()"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 295434] libalias' _RandomPort() should use htons() instead of ntohs()"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 20 May 2026 05:31:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295434
Bug ID: 295434
Summary: libalias' _RandomPort() should use htons() instead of
ntohs()
Product: Base System
Version: Unspecified
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: kern
Assignee: bugs@FreeBSD.org
Reporter: public@yusuke.pub
Created attachment 270933
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=270933&action=edit
Patch for replacing ntohs() to htons() in _RandomPort()
In sys/netinet/libalias/alias_db.c, the comment for _RandomPort() says that the
return value is in network byte order. The code currently uses ntohs() for the
byte-order conversion, but htons() would better reflect the intention. Since
both functions perform the same conversion, I think the attached patch can be
applied as-is.
--
You are receiving this mail because:
You are the assignee for the bug.