Skip to content
Prev Previous commit
Next Next commit
Comment: add_site: explain why inet_pton is endianess-save
  • Loading branch information
jnpkrn committed Jun 16, 2016
commit e40d8b7a5e1fbb4d02f0d322d71207e6a562cf46
5 changes: 4 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ static int add_site(char *addr_string, int type)
* increase even more.
* Whether there'll be a collision in real-life, with 3 or 5 nodes, is
* another question ... but for now get the ID from the binary
* representation - that had *no* collisions up to 32.0.0.0. */
* representation - that had *no* collisions up to 32.0.0.0.
* Note that POSIX mandates inet_pton to arange the address pointed
* to by "dst" in network byte order, assuring little/big-endianess
* mutual compatibility. */
if (inet_pton(AF_INET,
site->addr_string,
&site->sa4.sin_addr) > 0) {
Expand Down