Merge lp:~jtv/maas/validate-ipv4-ipv6-mix into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3015 |
Proposed branch: | lp:~jtv/maas/validate-ipv4-ipv6-mix |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
85 lines (+26/-2) 3 files modified
src/maasserver/models/network.py (+12/-1) src/maasserver/models/tests/test_network.py (+12/-0) src/maasserver/models/tests/test_node.py (+2/-1) |
To merge this branch: | bzr merge lp:~jtv/maas/validate-ipv4-ipv6-mix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+234938@code.launchpad.net |
Commit message
Validate that a Network's default_gateway (if set) is of the same address family as the Network itself. Disallow IPv4 gateways on IPv6 networks and vice versa.
Description of the change
I went through Network and NodeGroupInterface looking for situations where we might fail to detect impermissible mixed entry of IPv4/IPv6 addresses. The only cases I found were this one, and DNS server addresses. However we treat DNS server addresses as a black box, so I chose not to validate them in this way. ISC's DHCP server would not accept an IPv4 DNS server address on an IPv6 subnet or vice versa, but that's not to say the model shouldn't tolerate it. If the issue came up, we would probably want to filter unusable DNS server addresses where appropriate.
Jeroen
Looks good.