ip name-server 300.1.1.1 is accepted: net.isIp() is a shape check, at eight doors #1411

Closed
opened 2026-11-11 01:53:06 +00:00 by jaylouisw · 0 comments
Owner

Found by asking one question of every door that takes an address: what happens if I type one that cannot
exist?

r1(config)#ip name-server 300.1.1.1        → Name server 300.1.1.1
r1(config)#ip default-gateway 300.1.1.1    → Default gateway: 300.1.1.1
r1(config)#ip route 300.1.1.0 255.255.255.0 10.1.1.9
                                           → Route added: 300.1.1.0/24 via 10.1.1.9
r1(config)#ip route 192.0.2.0 255.255.255.0 300.1.1.9
                                           → Route added: 192.0.2.0/24 via 300.1.1.9
r1(config)#ip nat pool NP 300.1.1.1 300.1.1.9 netmask 255.255.255.0
                                           → NAT pool "NP" 300.1.1.1 - 300.1.1.9 netmask 255.255.255.0
r1(config-router)#neighbor 300.1.1.1 remote-as 65002
                                           → BGP neighbor 300.1.1.1 remote-as 65002

Eight doors took it, because net.isIp() asked the wrong question — four dotted groups of one to three digits, so
300.1.1.1 and 10.0.0.999 were addresses. ipToInt() has always checked the octets, which is why ip address,
vrrp 1 ip and ping refused the same value; ping had even worked around it with a private strict helper beside
the weak predicate (#1379) rather than fixing the predicate.

Two neighbours of the same mistake turned up in the sweep: ip route "validated" its mask with a call whose result
it threw away, so ip route 192.0.2.0 255.0.255.0 10.1.1.9 installed 192.0.2.0/8; and an access-list refusal
printed % [object Object].

What must be true instead

  • one address predicate, asked of the parser, used by every door;
  • a refusal quotes the value that was typed and says what it is not;
  • a mask is a contiguous run of ones then zeros, at every door that reads one;
  • a route with no next hop and no interface is not installed;
  • a refusal never prints an object.
Found by asking one question of every door that takes an address: **what happens if I type one that cannot exist?** ``` r1(config)#ip name-server 300.1.1.1 → Name server 300.1.1.1 r1(config)#ip default-gateway 300.1.1.1 → Default gateway: 300.1.1.1 r1(config)#ip route 300.1.1.0 255.255.255.0 10.1.1.9 → Route added: 300.1.1.0/24 via 10.1.1.9 r1(config)#ip route 192.0.2.0 255.255.255.0 300.1.1.9 → Route added: 192.0.2.0/24 via 300.1.1.9 r1(config)#ip nat pool NP 300.1.1.1 300.1.1.9 netmask 255.255.255.0 → NAT pool "NP" 300.1.1.1 - 300.1.1.9 netmask 255.255.255.0 r1(config-router)#neighbor 300.1.1.1 remote-as 65002 → BGP neighbor 300.1.1.1 remote-as 65002 ``` Eight doors took it, because `net.isIp()` asked the wrong question — four dotted groups of one to three digits, so `300.1.1.1` and `10.0.0.999` were addresses. `ipToInt()` has always checked the octets, which is why `ip address`, `vrrp 1 ip` and `ping` refused the same value; `ping` had even worked around it with a private strict helper beside the weak predicate (#1379) rather than fixing the predicate. Two neighbours of the same mistake turned up in the sweep: `ip route` "validated" its mask with a call whose result it threw away, so `ip route 192.0.2.0 255.0.255.0 10.1.1.9` installed `192.0.2.0/8`; and an `access-list` refusal printed `% [object Object]`. ## What must be true instead * one address predicate, asked of the parser, used by every door; * a refusal quotes the value that was typed and says what it is not; * a mask is a contiguous run of ones then zeros, at every door that reads one; * a route with no next hop and no interface is not installed; * a refusal never prints an object.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1411
No description provided.