[Kea-users] API call 'reservation-del' removes all v6 reservations.

Darren Ankney darren.ankney at gmail.com
Wed Mar 13 21:24:34 UTC 2024


Hi Andy,

I was not able to reproduce this in 2.4.0.  What version were you using?

I tested using this simple configuration:

{
  "Dhcp6": {
    "control-socket": {
      "socket-type": "unix",
      "socket-name": "/tmp/socket6"
    },
    "interfaces-config": {
      "interfaces": [
        "ens256"
      ]
    },
    "hosts-database": {
      "type": "mysql",
      "name": "kea",
      "user": "kea",
      "password": "kea",
    },
    "hooks-libraries": [
      {
        "library": "/usr/local/kea/2.4.0/lib/kea/hooks/libdhcp_host_cmds.so"
      }
    ],
    "subnet6": [
      {
        "id": 1,
        "subnet": "2001:db8::/64",
        "pools": [
          {
            "pool": "2001:db8::aaaa-2001:db8::ffff"
          }
        ]
      }
    ]
  }
}

I added a host reservation with this command:

{
  "command": "reservation-add",
  "arguments": {
    "reservation": {
      "subnet-id": 1,
      "duid": "1a:1b:1c:1d:1e:0a",
      "ip-addresses": [ "2001:db8::101" ]
    }
  }
}

and then another

{
  "command": "reservation-add",
  "arguments": {
    "reservation": {
      "subnet-id": 1,
      "duid": "1a:1b:1c:1d:1e:0b",
      "ip-addresses": [ "2001:db8::102" ]
    }
  }
}

I then had two reservations:

{
  "arguments": {
    "hosts": [
      {
        "client-classes": [],
        "duid": "1a:1b:1c:1d:1e:0a",
        "hostname": "",
        "ip-addresses": [
          "2001:db8::101"
        ],
        "option-data": [],
        "prefixes": [],
        "subnet-id": 1
      },
      {
        "client-classes": [],
        "duid": "1a:1b:1c:1d:1e:0b",
        "hostname": "",
        "ip-addresses": [
          "2001:db8::102"
        ],
        "option-data": [],
        "prefixes": [],
        "subnet-id": 1
      }
    ]
  },
  "result": 0,
  "text": "2 IPv6 host(s) found."
}

I then deleted one of them by IP address:

{
    "command": "reservation-del",
    "arguments": {
        "subnet-id": 1,
        "ip-address": "2001:db8::101"
    }
}

and still had one reservation left:

{
  "arguments": {
    "hosts": [
      {
        "client-classes": [],
        "duid": "1a:1b:1c:1d:1e:0b",
        "hostname": "",
        "ip-addresses": [
          "2001:db8::102"
        ],
        "option-data": [],
        "prefixes": [],
        "subnet-id": 1
      }
    ]
  },
  "result": 0,
  "text": "1 IPv6 host(s) found."
}


On Mon, Mar 11, 2024 at 11:19 AM Andrew Mulheirn via Kea-users
<kea-users at lists.isc.org> wrote:
>
> Hi all,
>
>
>
> I've noticed that using reservation-del against dhcp6 removes *all* reservations, while doing the same against dhcp4 behaves as expected and removes just the reservation that was specified.   I can't see why they behave differently.
>
>
>
> I have made reservations for 2a00:e340:1102::3 and 2a00:e340:1102::4 and can see them both when I do a reservation-get-all.
>
>
>
> Then I try to delete one of them.  Here is the call I am making for v6:
>
> {
>
>     "command": "reservation-del",
>
>     "service": ["dhcp6"],
>
>     "arguments": {
>
>         "subnet-id": 1,
>
>         "ip-address": "2a00:e340:1102::3"
>
>     }
>
> }
>
>
>
>
>
> When I look at the debug, I see messages just deleting this one reservation:
>
> INFO  COMMAND_RECEIVED Received command 'reservation-del'
>
> DEBUG HOOKS_CALLOUTS_BEGIN begin all callouts for hook $reservation_del
>
> INFO  HOST_CMDS_RESERV_DEL reservation-del command called (parameters: { "ip-address": "2a00:e340:1102::3", "subnet-id": 1 })
>
> INFO  HOST_CMDS_RESERV_DEL_SUCCESS reservation-del command success (parameters: { "ip-address": "2a00:e340:1102::3", "subnet-id": 1 })
>
> DEBUG HOOKS_CALLOUT_CALLED hooks library with index 2 has called a callout on hook $reservation_del that has address 0x7ff2f67cecb0 (callout duration: 5.882 ms)
>
> DEBUG HOOKS_CALLOUTS_COMPLETE completed callouts for hook $reservation_del (total callouts duration: 5.882 ms)
>
>
>
>
>
> However, when I do another reservation-get-all, the table is now empty:
>
> [
>
>     {
>
>         "arguments": {
>
>             "hosts": []
>
>         },
>
>         "result": 3,
>
>         "text": "0 IPv6 host(s) found."
>
>     }
>
> ]
>
>
>
>
>
> As I say, v4 works fine.   Any pointers would be most welcome,
>
>
>
> Cheers,
>
> Andy
>
>
> Andrew Mulheirn
>
> Senior Network Architect
>
> M: +44 (0) 74 3654 8126
>
> E: andrew.mulheirn at vorboss.com
>
> vorboss.com
>
>
> Not sure who currently provides your internet?
> Find out here and take our speed test.
>
>
> Disclaimer: This message is private and confidential. If you have received this message in error, please remove it from your system and notify us at sysadmin at vorboss.net or by telephone +44(0)20 3582 8500. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.   Privacy Note: Vorboss Limited may monitor email traffic data and also the content of email for the purposes of security. This email does not create or vary any contractual obligations between Vorboss Limited and the intended recipient.
>
> Vorboss Limited is a limited company registered in England and Wales. Registered number: 05678571. Registered Office: Vorboss Limited, Broadwalk House, 5 Appold Street, London, EC2A 2AG, UNITED KINGDOM.
>
> --
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users


More information about the Kea-users mailing list