summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Matthias Schaefer <philipp.matthias.schaefer@posteo.de>2016-02-04 18:19:23 +0100
committerPhilipp Matthias Schaefer <philipp.matthias.schaefer@posteo.de>2016-02-04 18:19:23 +0100
commit645c48f2890cd5ef993f6a73970a693e26ca5f91 (patch)
treed3a06c19ee3ce746ab5a87e7ea758d411940820d /src
parentd5da7dcf93f0b39518973af6a8f66663a6838825 (diff)
downloadnix-645c48f2890cd5ef993f6a73970a693e26ca5f91.zip
Add comment on IPv6 address endianness.
Diffstat (limited to 'src')
-rw-r--r--src/sys/socket/addr.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs
index 89503600..0bb1bb12 100644
--- a/src/sys/socket/addr.rs
+++ b/src/sys/socket/addr.rs
@@ -281,6 +281,10 @@ impl fmt::Display for Ipv4Addr {
#[derive(Clone, Copy)]
pub struct Ipv6Addr(pub libc::in6_addr);
+// Note that IPv6 addresses are stored in big endian order on all architectures.
+// See https://tools.ietf.org/html/rfc1700 or consult your favorite search
+// engine.
+
macro_rules! to_u8_array {
($($num:ident),*) => {
[ $(($num>>8) as u8, ($num&0xff) as u8,)* ]