3 ms·
lol so those ping to two different addresses: ping 192.168.1.64 ping 192.168.1.064 Good material for underhanded c contest...
by pingofdoom 8y ago
lol so those ping to two different addresses:
ping 192.168.1.64
ping 192.168.1.064
Good material for underhanded c contest...
- akeruu 8y agoThis happens more often then you might think. A lot of people are adding padding when they need to store IPs. So they can be easily sorted using alphanumeric sort: 192.168.001.001 192.168.001.002 192.168.001.003 ... 192.168.001.254 And then use it that way to connect to servers, causing lots of confusions.
- rashkov 8y agowait, really? padding with zeros maps to a different IP address than the non-padded version? Is that because a leading zero causes it to be interpreted as an octal number?
- iooi 8y agoYes. In [2]: socket.inet_aton('226.000.000.037') Out[2]: b'\xe2\x00\x00\x1f' In [3]: socket.inet_aton('226.000.000.37') Out[3]: b'\xe2\x00\x00%' In [4]: socket.inet_ntoa(b'\xe2\x00\x00\x1f') Out[4]: '226.0.0.31' In [5]: socket.inet_ntoa(b'\xe2\x00\x00%') Out[5]: '226.0.0.37'
- kiallmacinnes 8y agoOh, wow. I.. wow. No words come to me! Learn something new everyday!