lan: Ignore 'ipv6-prefix' of DHCPv6 leases
If assigned IPv6 prefix is large enough, downstream router gets both IPv6 address for wan interface and IPv6 prefix for its own networks from odhcpd.
This cause fetching DHCPv6 leases data in such setups to fail ('missing key ipv6-addr
').
Ignore ipv6-prefix
or any other unexpected values and use only ipv6-addr
data.
For instance:
$ ubus call dhcp ipv6leases
{
"device": {
"br-guest-turris": {
"leases": [
]
},
"br-lan": {
"leases": [
{
"duid": "<DUID redacted>",
"iaid": 1,
"hostname": "downstream-router",
"accept-reconf": true,
"assigned": 17,
"flags": [
"bound",
"static"
],
"ipv6-addr": [
{
"address": "2001:xxxx:xxxx::11",
"preferred-lifetime": 42,
"valid-lifetime": 42
},
{
"address": "fd60:xxxx:xxxx::11",
"preferred-lifetime": 42,
"valid-lifetime": 42
}
],
"valid": 42
},
{
"duid": "<DUID redacted>",
"iaid": 1,
"hostname": "downstream-router",
"accept-reconf": true,
"assigned": 4,
"flags": [
"bound",
"static"
],
"ipv6-prefix": [ <--- We don't care about this part right now, let's ignore it.
{
"address": "2001:xxxx:xxxx:4::",
"preferred-lifetime": 42,
"valid-lifetime": 42,
"prefix-length": 62
},
{
"address": "fd60:xxxx:xxxx:4::",
"preferred-lifetime": 42,
"valid-lifetime": 42,
"prefix-length": 62
}
],
"valid": 42
}
]
}
}
}