config-set return incorrect hash (from config that was overwritten)
config-set is returning hash of previous config.
Let's run this scenario:
- send config-get to server - included hash (hash1)
- change returned config
- send config-set to kea with modified config - response include hash (hash2)
- send config-get to check values - response include hash (hash3)
Problem is when Kea sends back response to config-set (with new config) it returns hash value but of the old config (in this scenario hash1). Result should be hash1 != hash2 == hash3
but in reality it's hash1 == hash2 != hash3
first config get:
{'arguments': {}, 'command': 'config-get', 'service': ['dhcp4']}
send to address: http://192.168.51.3:8000
[
{
"arguments": {
"Dhcp4": {
"allocator": "iterative",
"authoritative": false,
"boot-file-name": "",
"calculate-tee-times": false,
"control-socket": {
"socket-name": "/home/wlodek/installed/git/var/run/kea/control_socket",
"socket-type": "unix"
},
"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,
"ddns-use-conflict-resolution": true,
"decline-probation-period": 86400,
"dhcp-ddns": {
"enable-updates": false,
"max-queue-size": 1024,
"ncr-format": "JSON",
"ncr-protocol": "UDP",
"sender-ip": "0.0.0.0",
"sender-port": 0,
"server-ip": "127.0.0.1",
"server-port": 53001
},
"dhcp-queue-control": {
"capacity": 64,
"enable-queue": false,
"queue-type": "kea-ring4"
},
"dhcp4o6-port": 0,
"early-global-reservations-lookup": false,
"echo-client-id": true,
"expired-leases-processing": {
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"reclaim-timer-wait-time": 10,
"unwarned-reclaim-cycles": 5
},
"hooks-libraries": [],
"host-reservation-identifiers": [
"hw-address",
"duid",
"circuit-id",
"client-id"
],
"hostname-char-replacement": "",
"hostname-char-set": "[^A-Za-z0-9.-]",
"interfaces-config": {
"interfaces": [
"enp0s9"
],
"re-detect": true
},
"ip-reservations-unique": true,
"lease-database": {
"type": "memfile"
},
"loggers": [
{
"debuglevel": 99,
"name": "kea-dhcp4",
"output_options": [
{
"flush": true,
"maxsize": 10240000,
"maxver": 1,
"output": "/home/wlodek/installed/git/var/log/kea.log",
"pattern": ""
}
],
"severity": "DEBUG"
}
],
"match-client-id": true,
"multi-threading": {
"enable-multi-threading": true,
"packet-queue-size": 64,
"thread-pool-size": 0
},
"next-server": "0.0.0.0",
"option-data": [],
"option-def": [],
"parked-packet-limit": 256,
"rebind-timer": 2000,
"renew-timer": 1000,
"reservations-global": false,
"reservations-in-subnet": true,
"reservations-lookup-first": false,
"reservations-out-of-pool": false,
"sanity-checks": {
"extended-info-checks": "fix",
"lease-checks": "warn"
},
"server-hostname": "",
"server-tag": "",
"shared-networks": [],
"statistic-default-sample-age": 0,
"statistic-default-sample-count": 20,
"store-extended-info": false,
"subnet4": [],
"t1-percent": 0.5,
"t2-percent": 0.875,
"valid-lifetime": 4000
},
"hash": "5FBC030220D411E42FFBE0A0EE394A6A5554AF8469C5FD5C35683A1ED476E7D2"
},
"result": 0
}
]
now we send back modified config in config-set (in this case global reservation is added)
{'arguments': {'Dhcp4': {'allocator': 'iterative',
'authoritative': False,
'boot-file-name': '',
'calculate-tee-times': False,
'control-socket': {'socket-name': '/home/wlodek/installed/git/var/run/kea/control_socket',
'socket-type': 'unix'},
'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,
'ddns-use-conflict-resolution': True,
'decline-probation-period': 86400,
'dhcp-ddns': {'enable-updates': False,
'max-queue-size': 1024,
'ncr-format': 'JSON',
'ncr-protocol': 'UDP',
'sender-ip': '0.0.0.0',
'sender-port': 0,
'server-ip': '127.0.0.1',
'server-port': 53001},
'dhcp-queue-control': {'capacity': 64,
'enable-queue': False,
'queue-type': 'kea-ring4'},
'dhcp4o6-port': 0,
'early-global-reservations-lookup': False,
'echo-client-id': True,
'expired-leases-processing': {'flush-reclaimed-timer-wait-time': 25,
'hold-reclaimed-time': 3600,
'max-reclaim-leases': 100,
'max-reclaim-time': 250,
'reclaim-timer-wait-time': 10,
'unwarned-reclaim-cycles': 5},
'hooks-libraries': [],
'host-reservation-identifiers': ['hw-address',
'duid',
'circuit-id',
'client-id'],
'hostname-char-replacement': '',
'hostname-char-set': '[^A-Za-z0-9.-]',
'interfaces-config': {'interfaces': ['enp0s9'],
're-detect': True},
'ip-reservations-unique': True,
'lease-database': {'type': 'memfile'},
'loggers': [{'debuglevel': 99,
'name': 'kea-dhcp4',
'output_options': [{'flush': True,
'maxsize': 10240000,
'maxver': 1,
'output': '/home/wlodek/installed/git/var/log/kea.log',
'pattern': ''}],
'severity': 'DEBUG'}],
'match-client-id': True,
'multi-threading': {'enable-multi-threading': True,
'packet-queue-size': 64,
'thread-pool-size': 0},
'next-server': '0.0.0.0',
'option-data': [],
'option-def': [],
'parked-packet-limit': 256,
'rebind-timer': 2000,
'renew-timer': 1000,
'reservations': [{'hw-address': 'ff:01:02:03:ff:04'}],
'reservations-global': False,
'reservations-in-subnet': True,
'reservations-lookup-first': False,
'reservations-out-of-pool': False,
'sanity-checks': {'extended-info-checks': 'fix',
'lease-checks': 'warn'},
'server-hostname': '',
'server-tag': '',
'shared-networks': [],
'statistic-default-sample-age': 0,
'statistic-default-sample-count': 20,
'store-extended-info': False,
'subnet4': [],
't1-percent': 0.5,
't2-percent': 0.875,
'valid-lifetime': 4000}},
'command': 'config-set',
'service': ['dhcp4']}
send to address: http://192.168.51.3:8000
[
{
"arguments": {
"hash": "5FBC030220D411E42FFBE0A0EE394A6A5554AF8469C5FD5C35683A1ED476E7D2" <<<< same value as for previous configuration
},
"result": 0,
"text": "Configuration successful."
}
]
and let's repeat check with config-get:
{'arguments': {}, 'command': 'config-get', 'service': ['dhcp4']}
send to address: http://192.168.51.3:8000
[
{
"arguments": {
"Dhcp4": {
"allocator": "iterative",
"authoritative": false,
"boot-file-name": "",
"calculate-tee-times": false,
"control-socket": {
"socket-name": "/home/wlodek/installed/git/var/run/kea/control_socket",
"socket-type": "unix"
},
"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,
"ddns-use-conflict-resolution": true,
"decline-probation-period": 86400,
"dhcp-ddns": {
"enable-updates": false,
"max-queue-size": 1024,
"ncr-format": "JSON",
"ncr-protocol": "UDP",
"sender-ip": "0.0.0.0",
"sender-port": 0,
"server-ip": "127.0.0.1",
"server-port": 53001
},
"dhcp-queue-control": {
"capacity": 64,
"enable-queue": false,
"queue-type": "kea-ring4"
},
"dhcp4o6-port": 0,
"early-global-reservations-lookup": false,
"echo-client-id": true,
"expired-leases-processing": {
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"reclaim-timer-wait-time": 10,
"unwarned-reclaim-cycles": 5
},
"hooks-libraries": [],
"host-reservation-identifiers": [
"hw-address",
"duid",
"circuit-id",
"client-id"
],
"hostname-char-replacement": "",
"hostname-char-set": "[^A-Za-z0-9.-]",
"interfaces-config": {
"interfaces": [
"enp0s9"
],
"re-detect": true
},
"ip-reservations-unique": true,
"lease-database": {
"type": "memfile"
},
"loggers": [
{
"debuglevel": 99,
"name": "kea-dhcp4",
"output_options": [
{
"flush": true,
"maxsize": 10240000,
"maxver": 1,
"output": "/home/wlodek/installed/git/var/log/kea.log",
"pattern": ""
}
],
"severity": "DEBUG"
}
],
"match-client-id": true,
"multi-threading": {
"enable-multi-threading": true,
"packet-queue-size": 64,
"thread-pool-size": 0
},
"next-server": "0.0.0.0",
"option-data": [],
"option-def": [],
"parked-packet-limit": 256,
"rebind-timer": 2000,
"renew-timer": 1000,
"reservations": [
{
"boot-file-name": "",
"client-classes": [],
"hostname": "",
"hw-address": "ff:01:02:03:ff:04",
"next-server": "0.0.0.0",
"option-data": [],
"server-hostname": ""
}
],
"reservations-global": false,
"reservations-in-subnet": true,
"reservations-lookup-first": false,
"reservations-out-of-pool": false,
"sanity-checks": {
"extended-info-checks": "fix",
"lease-checks": "warn"
},
"server-hostname": "",
"server-tag": "",
"shared-networks": [],
"statistic-default-sample-age": 0,
"statistic-default-sample-count": 20,
"store-extended-info": false,
"subnet4": [],
"t1-percent": 0.5,
"t2-percent": 0.875,
"valid-lifetime": 4000
},
"hash": "144D4F24E1AA66AF20A02966B6150DAD5D86B134C396FF571538CE458A8CE1A7" <<< it's changed
},
"result": 0
}
]
Edited by Wlodzimierz Wencel