3 ms·
I spent hours debugging an issue that boiled down to an IPV4 parser that treated leading zeroes as octal. Connections to 192.168.123.100 worked as expected. Co
by jweather 6y ago
I spent hours debugging an issue that boiled down to an IPV4 parser that treated leading zeroes as octal.
Connections to 192.168.123.100 worked as expected. Connections to 192.168.123.034 went to 192.168.123.28. I thought sure it was an issue in my TCP client code, which was handling connections to hundreds of different devices.
Guilty party was Poco::Net library if I recall correctly. I can maybe see this making sense if you provide four octal digits (0377), but not three, and I have a hard time believing anybody has ever used this on purpose.
- ccakes 6y agoThat’s correct behaviour fwiw - there are many ways to write valid IPv4 addresses which aren’t necessarily intuitive