lease_cmds incorrect error when adding PD lease, lease_cmds doc update
While figuring out and answer for @peterd's question related to SF1892, I found a number of annoying issues:
- Incorrect error: I was trying to add a PD lease using this command:
{
"command": "lease6-add",
"arguments": {
"subnet-id": 1,
"ip-address": "2001:db8:1::5",
"prefix-len": 48,
"type": "pd",
"duid": "1a:1b:1c:1d:1e:1f:20:21:22:23:24",
"iaid": 5678
}
}
And Kea told me Incorrect lease type: pd, the only supported values are: na, ta and pd
. What it should have said "only supported values are IA_NA, IA_PD.
-
The example for lease6-add in Section 16.15.3 uses lease4-add command.
-
There is no example how to delete a lease.
The following basic example can be used:
{
"command": "lease6-del",
"arguments": {
"ip-address": "2001:db8:1::",
"type": "IA_PD",
"subnet-id": 1
}
}
- If "prefix-len" is specified in the lease6-del, it is ignored. I've added 2001:db8::/48 and then tried to delete 2001:db8::/123 and the deletion command succeeded. I think it should fail.
Adding PD lease:
{
"command": "lease6-add",
"arguments": {
"subnet-id": 1,
"ip-address": "2001:db8::",
"prefix-len": 64,
"type": "IA_PD",
"duid": "1a:1b:1c:1d:1e:1f:20:21:22:23:24",
"iaid": 5678
}
}
deleting PD lease of different length:
{
"command": "lease6-del",
"arguments": {
"ip-address": "2001:db8::",
"prefix-len": 1234,
"type": "IA_PD",
"subnet-id": 1
}
}
Looks like the whole type parameter is ignored completely. IMHO if not specified, any matching PD lease should be deleted. If specified, the lease should only be deleted if prefix-length matches.
Edited by Tomek Mrugalski