]> git.ipfire.org Git - thirdparty/man-pages.git/commit
ip.7: INADDR_* values cannot be assigned directly to 's_addr'
authorRicardo Biehl Pasquali <pasqualirb@gmail.com>
Thu, 14 Dec 2017 21:18:20 +0000 (19:18 -0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 18 Dec 2017 16:36:57 +0000 (17:36 +0100)
commitc0a0e532ae3d8b182fcc66273fa2ae9f01cb228f
treece02d8db4568632dc58c0413000d1f03b5ee6ee9
parent3ca4400d74ba4b6b44998f62c9b0e0579cb3c289
ip.7: INADDR_* values cannot be assigned directly to 's_addr'

According to The Open Group Base Specifications Issue 7, RATIONALE
section of
http://pubs.opengroup.org/onlinepubs/9699919799/ basedefs/netinet_in.h.html
some INADDR_* values must be converted using htonl().

INADDR_ANY and INADDR_BROADCAST are byte-order-neutral so they do
not require htonl(), however I only comment this fact in NOTES.
On the text I recommend to use htonl(), "even if for some subset
it's not necessary".

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/ip.7