[Kea-users] config-hash-get – uses full config to hash?

tachibanashita at outlook.com tachibanashita at outlook.com
Wed May 14 12:50:09 UTC 2025


I also noticed when I used “config-get” API, it would return a has value at the end. I compared both API outputs and they are the same.




...
"hash": “8CBF975...C36A513A.ADDFCD6E5980...6E"
},
"result": 0
}
]

On May 13, 2025, at 2:34 AM, Diogo André de Assumpção <daa at meta.com> wrote:

Yes, I did mean the config in /etc/kea. Getting the config with config-write seems to be the same as config-get, it returns the config with all the defaults, example:



From config-write:

{
  "Dhcp4": {
    "allocator": "iterative",
    "authoritative": false,
    "boot-file-name": "",
    "calculate-tee-times": false,
    "control-socket": {
      "socket-name": "/tmp/kea4-ctrl-socket",
      "socket-type": "unix"
    },
    "ddns-conflict-resolution-mode": "check-with-dhcid",
    "ddns-generated-prefix": "myhost",
    "ddns-override-client-update": false,
    "ddns-override-no-update": false,
    "ddns-qualifying-suffix": "",
    "ddns-replace-client-name": "never",
    "ddns-send-updates": true,
    "ddns-update-on-renew": false,


And /etc/kea/kea-dhcp4.conf


{
    "Dhcp4": {
        "store-extended-info": true,
        "interfaces-config": {
            "interfaces": [
                "eth0/192.168.1.1"
            ]
        },
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/tmp/kea4-ctrl-socket"
        },
        "lease-database": {
            "type": "memfile",
            "name": "/tmp/kea-dhcp4.csv",
            "lfc-interval": 7200,
            "persist": true
        },



From: tachibanashita at outlook.com<mailto:tachibanashita at outlook.com> <tachibanashita at outlook.com<mailto:tachibanashita at outlook.com>>
Date: Monday, May 12, 2025 at 5:42 PM
To: Kea user's list <kea-users at lists.isc.org<mailto:kea-users at lists.isc.org>>
Cc: Diogo André de Assumpção <daa at meta.com<mailto:daa at meta.com>>
Subject: Re: [Kea-users] config-hash-get – uses full config to hash?
“Using the same config that I have loaded in the server” do you mean the config file in /etc/kea? If so, can you use the write-config API to get the configuration in memory and compare it again? On May 12, 2025, at 2: 43 AM, Diogo André de Assumpção
“Using the same config that I have loaded in the server” do you mean the config file in /etc/kea? If so, can you use the write-config API to get the configuration in memory and compare it again?





On May 12, 2025, at 2:43 AM, Diogo André de Assumpção via Kea-users <kea-users at lists.isc.org> wrote:

Hi all,

I was exploring using the `config-hash-get` command to get a hash of the loaded config and then compare with a candidate config to see if anything was change before loading.

Using the same config that I have loaded in the server, I couldn’t get a hash that matched the one we get via the `config-hash-get` command.

Is that something in the way I’m generating the hash? I’m passing the entire dhcp4 config (ie. {"Dhcp4":…}) to the hash function.

I also noticed that if I do a `config-get` command, the output will contain every optional field that is usually not present in a manually generated config. Could that be the reason why the hashes don’t match?

Thanks,
– Diogo
--
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/<https://urldefense.com/v3/__https:/www.isc.org/contact/__;!!Bt8RZUm9aw!_pgED41K5-ladaP1HQfj0HvGM9GeX0c-2JQJIEmTLCJ57_FJSkQlrAPOna8vAy1XiR7goA6rQHheNnTz_Ac$> for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users<https://urldefense.com/v3/__https:/lists.isc.org/mailman/listinfo/kea-users__;!!Bt8RZUm9aw!_pgED41K5-ladaP1HQfj0HvGM9GeX0c-2JQJIEmTLCJ57_FJSkQlrAPOna8vAy1XiR7goA6rQHhe-0dQpbs$>.

Kea-users mailing list
Kea-users at lists.isc.org<mailto:Kea-users at lists.isc.org>
https://lists.isc.org/mailman/listinfo/kea-users<https://urldefense.com/v3/__https:/lists.isc.org/mailman/listinfo/kea-users__;!!Bt8RZUm9aw!_pgED41K5-ladaP1HQfj0HvGM9GeX0c-2JQJIEmTLCJ57_FJSkQlrAPOna8vAy1XiR7goA6rQHhe-0dQpbs$>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20250514/2ad12c05/attachment-0001.htm>


More information about the Kea-users mailing list