`network-get` can return incorrect CIDRs

Bug #1770127 reported by Eric Claude Jones on 2018-05-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju
Medium
Eric Claude Jones

Bug Description

`network-get` can report invalid CIDRs. The CIDR is reported in an invalid <hostname>/128 notation (RFC 4291 & RFC 4632) where the decimal value is always fixed at 128.

One way this can happen is as follows: When a machine is manually provisioned using a resolvable hostname (e.g. `juju add-machine ssh:jujucharms.com`) the hostname will end up in the `network-get` egress-subnet CIDR output (and other places) and, as mentioned above, the decimal part of the CIDR will be at 128.

tags: added: add-machine network
removed: ne
summary: - `netowrk-get` can return incorrect CIDRs
+ `network-get` can return incorrect CIDRs
Ian Booth (wallyworld) on 2018-05-28
tags: added: network-get
Eric Claude Jones (ecjones) wrote :

One, straight forward, but potentially noisy way to fix this is to use the type system to prevent the propagation of invalid data. Replacing the existing `string` type with a `net.IP` type throughout the program would ensure that all code paths are in an IP format and force the code to explicitly resolve any hostnames on input.

Changed in juju:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Eric Claude Jones (ecjones)
importance: Low → Medium
Changed in juju:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers