Client classes are case insensitive in the leaseX_stat_by_client_class MySQL table
Replication steps:
- Start
kea-dhcp4
with two classes having the same name, but with different capitalization, with limits hook library loaded, and a MySQL lease backend, like in the following example. Add to the configuration whatever else is needed for dealing with DHCP traffic likeinterfaces-config
andsubnet4
.
{
"Dhcp4": {
"client-classes": [
{
"name": "myclass",
"test": "member('ALL')"
},
{
"name": "MYCLASS",
"test": "member('ALL')"
}
],
"hooks-libraries": [
{
"library": "/opt/kea/lib/kea/hooks/libdhcp_limits.so"
}
],
"lease-database": {
"host": "127.0.0.1",
"name": "keatest",
"password": "keatest",
"type": "mysql",
"user": "keatest"
}
}
}
- Send any number of DORAs. Each of the two client classes has to be assigned at least to one DORA.
- Get all rows from
lease4_stat_by_client_class
. Notice that one of the classes is missing, and the other one is present with more leases thanALL
which should not be possible. The problem is that both classes are registered under only one of them.
$ mysql --user=root --password=keatest --database=keatest --execute='SELECT * FROM lease4_stat_by_client_class;'
+--------------+--------+
| client_class | leases |
+--------------+--------+
| ALL | 29 |
| myclass | 58 |
| UNKNOWN | 29 |
+--------------+--------+
- Get the user context from
lease4
. See that both classes are properly added to the user context.
$ mysql --user=root --password=keatest --database=keatest -e 'SELECT DISTINCT user_context FROM lease4;'
+-----------------------------------------------------------------------------+
| user_context |
+-----------------------------------------------------------------------------+
| { "ISC": { "client-classes": [ "ALL", "myclass", "MYCLASS", "UNKNOWN" ] } } |
+-----------------------------------------------------------------------------+
Replicates for kea-dhcp6
too.
Does not replicate on a PostgreSQL lease backend, meaning there are separate entries for each class e.g. myclass
and MYCLASS
. This is the expected behavior.
Used this version to replicate: Server version: 10.11.2-MariaDB-1:10.11.2+maria~ubu2204 mariadb.org binary distribution