简体   繁体   中英

inet_ntop provides different returns for the same ipv6 address on different platforms

On my Mac, inet_ntop produces this IPv6 address for a certain 128-bit value:

2001::53aa:64c:422:2ece:a29c:9cf6.51391

On my FC15 Linux system, I get this IPv6 address presentation:

2001:0:53aa:64c:422:2ece:a29c:9cf6.51391

My understanding is that zeros between :: can be ignored, so I think that these are the same address. Are they the same address? If so, why do the different operating systems display it differently?

Thanks.

Yes, they are the same address. The :: means 'all zeroes', the other notation shows the zero.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM