1.1.1.1 is a palindrome

TL;DR: 10.2.0.1 becomes 0x0A020001: 0A is 10, 02 is 2, 00 is 0, 01 is 1, all in order. so even after the report, i sort of had to stew in this mess. it was extremely confusing. the problem is that networkmanager never reads it as a number. it reads the four bytes that number is stored as, one at a time, and expects them to be the octets in order. a little-endian machine stores the lowest byte first, so 0x0A020001 sits in memory backwards: that line had been in nmrs since december of 2025, and the tests covering it passed for seven months. this is one of them: i confidently merged this in without thinking twice about it. in earnest, much of the work being done around the time was fueled by my newfound excitement with claude code. the assertion calls u32::from, which is the exact call under test. this checks that the function is equal to itself.
Longer Read: (despite the issue title, the interface address was never affected, only dns.) networkmanager wants an array of u32 and i have an Ipv4Addr. std has a From impl for exactly that! so that’s what got used.
Read the full story at Cachebag →
Related Skills: Software Design
Wider Reading: Refactoring Guru — Software Designroadmap.sh — Software DesignCoursera — Software Design

💬 0 comments

No comments yet — be the first to say what you think.