$binary_remote_addr byte order (big-endian guaranteed?)

Maxim Dounin mdounin at mdounin.ru
Fri Nov 5 15:12:11 MSK 2010


On Fri, Nov 05, 2010 at 04:06:44AM -0400, helen wrote:

> In what format is $binary_remote_addr?  Test shows network byte order
> (big-endian), but is that guaranteed?

It's remote address as returned by accept(), either s_addr for 
ipv4 or s6_addr for ipv6.  Both are guaranteed to be in network 
byte order[1].  Value for unix socket connections is unspecified.

[1] http://www.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html

> English wiki doesn't say, and my Russian leaves much to be desired.

Use the Source, Luke! ;)

Maxim Dounin

More information about the nginx mailing list