Issue with AAAA records formatting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Designate |
Triaged
|
Medium
|
Unassigned |
Bug Description
Code used to format IPv6 address for AAAA records in `base.py`[1] in following cases:
* Address contains `::`;
* One to four of the first nibbles in a group of four: `2001:db8:2::1`.
The test[2] relating to this part of the code is also incorrect: representing the IP `1762:B03::1:AF18` would result in the same `octet0` to `octet3` while the address is different.
A more canonical approach of the representation would be as follows:
```python
expect = {'octet0': '1762', 'octet1': '0000', 'octet2': '0000', 'octet3': '0000'
'octet4': '0000', 'octet5': '0B03', 'octet6': '0001'
'octet7': 'AF18', 'ip_version': 6,
```
References:
1. https:/
2. https:/
Frankly Designate should not be using regex to parse these addresses at all.
It should use python ipaddress module and normalize the address (explode for example) and use __format__ on the IPv6Address object to manipulate it for other required representations.