iproute2: unexpected expansion of IPv4 addresses
From: sdomi <hidden>
Date: 2024-10-18 12:28:33
Hi, I'm running iproute2-6.10.0 (from Alpine edge repositories), and I noticed that when manipulating the routes using short-hand addresses, the expansion is conducted in an unusual manner: `ip r a 1.1 via 127.1` will result in `1.1.0.0 via 127.1.0.0 dev lo`, while I'd expect it to be equivalent to `ip r a 1.0.0.1 via 127.0.0.1`. The same issue is present when manipulating addresses (e.g. `ip a a 127.1.1 dev lo` results in `127.1.1.0` instead of `127.1.0.1`) FWIW, I wasn't able to find an RFC which specified how this should be implemented, and the deeper I look into it, the more it feels like a 40-year old BSD4.2 quirk that somehow lives on. Nonetheless, I think it would be nice to either validate against using shorthands (as it can cause confusion), or mimic what `ping` and other such utilities do. ~sdomi