comma escaping doesn't work in string options
name: Bug report
about: comma escaping doesn't work in string options
Describe the bug
As mentioned in documentation we try to escape comma (,) symbol in proprietary option fro Avaya IP Phones.But that doesn't work.
To Reproduce started kea-daemon4 connected avaya phone to network address is assigned to phone, options assigned phone doesn't connect to phone server.
Expected behavior
option 242 must looks like: "MCIPADD=192.168.131.133, MCPORT=1719" phone is connected to phone server.
it works fine when we use Cisco commutator as DHCP with options set like this:
option 242 ascii MCIPADD=192.168.131.133,MCPORT=1719
Environment:
[root@dns-core menv]# rpm -qa|grep kea
isc-kea-hooks-1.7.3-isc0009420191217090201.el7.x86_64
isc-kea-1.7.3-isc0009420191217090201.el7.x86_64
isc-kea-libs-1.7.3-isc0009420191217090201.el7.x86_64
[root@dns-core menv]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
- Kea version: 1.7.3 pre-RPMs from cloudsmith.io
- OS: CentOS Linux release 7.7.1908 (Core)
Additional Information configuration:
[
{
"arguments": {
"Dhcp4": {
"authoritative": false,
"boot-file-name": "",
"calculate-tee-times": false,
"client-classes": [
{
"boot-file-name": "/undionly.kpxe.1.0.1",
"name": "Legacy_Intel_x86PC",
"next-server": "192.168.134.52",
"option-data": [
],
"option-def": [
],
"server-hostname": "",
"test": "option[93].hex == 0x0000"
},
{
"boot-file-name": "/pxelinux.0.4.05",
"name": "XClient_iPXE",
"next-server": "192.168.134.52",
"option-data": [
],
"option-def": [
],
"server-hostname": "",
"test": "substring(option[77].hex,1,4) == 'PXE'"
},
{
"boot-file-name": "",
"name": "Cisco_IP_Phone",
"next-server": "0.0.0.0",
"option-data": [
],
"option-def": [
],
"server-hostname": "",
"test": "substring(option[60].hex,0,5) == 'Cisco'"
}
],
"config-control": {
"config-databases": [
{
"host": "localhost",
"name": "kea",
"password": "********",
"port": 3306,
"type": "mysql",
"user": "kea"
}
],
"config-fetch-wait-time": 20
},
"control-socket": {
"socket-name": "/var/run/kea/socket-v4",
"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,
"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": 500,
"enable-queue": false,
"queue-type": "kea-ring4"
},
"dhcp4o6-port": 0,
"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": [
{
"library": "/usr/lib64/kea/hooks/libdhcp_mysql_cb.so"
},
{
"library": "/usr/lib64/kea/hooks/libdhcp_lease_cmds.so"
}
],
"host-reservation-identifiers": [
"hw-address",
"duid",
"circuit-id",
"client-id"
],
"hosts-databases": [
{
"host": "localhost",
"name": "kea",
"password": "********",
"port": 3306,
"reconnect-wait-time": 500,
"type": "mysql",
"user": "kea"
}
],
"interfaces-config": {
"dhcp-socket-type": "udp",
"interfaces": [
"eth0"
],
"outbound-interface": "use-routing",
"re-detect": true
},
"lease-database": {
"host": "localhost",
"lfc-interval": 1800,
"name": "kea_leases",
"password": "********",
"port": 3306,
"reconnect-wait-time": 500,
"type": "mysql",
"user": "kea"
},
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [
{
"flush": true,
"output": "/var/log/kea/server.log",
"pattern": "%d{%j %H:%M:%S.%q} %c %m\n"
}
],
"severity": "INFO"
},
{
"debuglevel": 99,
"name": "kea-dhcp4.options",
"output_options": [
{
"flush": true,
"output": "/var/log/kea/options.log",
"pattern": "%d{%j %H:%M:%S.%q} %c %m\n"
}
],
"severity": "DEBUG"
},
{
"debuglevel": 99,
"name": "kea-dhcp4.packets",
"output_options": [
{
"flush": true,
"output": "/var/log/kea/packets.log",
"pattern": "%d{%j %H:%M:%S.%q} %c %m\n"
}
],
"severity": "DEBUG"
},
{
"name": "kea-dhcp4.leases",
"output_options": [
{
"flush": true,
"output": "/var/log/kea/leases.log",
"pattern": "%d{%j %H:%M:%S.%q} %c %m\n"
}
],
"severity": "INFO"
}
],
"match-client-id": false,
"next-server": "0.0.0.0",
"option-data": [
{
"always-send": false,
"code": 252,
"csv-format": true,
"data": "http://wpad/wpad.pac",
"space": "dhcp4"
},
{
"always-send": false,
"code": 4,
"csv-format": true,
"data": "192.168.134.52, 192.168.134.13",
"name": "time-servers",
"space": "dhcp4"
},
{
"always-send": false,
"code": 6,
"csv-format": true,
"data": "192.168.134.53, 192.168.160.53",
"name": "domain-name-servers",
"space": "dhcp4"
},
{
"always-send": false,
"code": 15,
"csv-format": true,
"data": "kmz.ts",
"name": "domain-name",
"space": "dhcp4"
}
],
"option-def": [
{
"array": false,
"code": 252,
"encapsulate": "",
"name": "autoproxy",
"record-types": "",
"space": "dhcp4",
"type": "string"
},
{
"array": true,
"code": 150,
"encapsulate": "",
"name": "tftp-server-voice",
"record-types": "",
"space": "dhcp4",
"type": "ipv4-address"
},
{
"array": false,
"code": 242,
"encapsulate": "",
"name": "tftp-server-voice-avaya",
"record-types": "",
"space": "dhcp4",
"type": "string"
}
],
"rebind-timer": 2000,
"renew-timer": 1000,
"reservation-mode": "all",
"sanity-checks": {
"lease-checks": "warn"
},
"server-hostname": "",
"server-tag": "dns-core",
"shared-networks": [
{
"name": "test-one_vlan",
"option-data": [
],
"relay": {
"ip-addresses": [
]
},
"subnet4": [
{
"4o6-interface": "",
"4o6-interface-id": "",
"4o6-subnet": "",
"id": 22028,
"option-data": [
{
"always-send": false,
"code": 150,
"csv-format": true,
"data": "192.168.160.48, 192.168.131.3",
"space": "dhcp4"
},
{
"always-send": false,
"code": 242,
"csv-format": true,
"data": "MCIPADD=192.168.131.133\\, MCPORT=1719",
"space": "dhcp4"
},
{
"always-send": false,
"code": 3,
"csv-format": true,
"data": "192.168.111.65",
"name": "routers",
"space": "dhcp4"
}
],
"pools": [
{
"client-class": "Cisco_IP_Phone",
"option-data": [
],
"pool": "192.168.111.66-192.168.111.72"
},
{
"option-data": [
],
"pool": "192.168.111.73-192.168.111.78"
}
],
"relay": {
"ip-addresses": [
]
},
"reservations": [
],
"subnet": "192.168.111.64/28"
}
]
},
{
"name": "test-two_vlan",
"option-data": [
],
"relay": {
"ip-addresses": [
]
},
"subnet4": [
{
"4o6-interface": "",
"4o6-interface-id": "",
"4o6-subnet": "",
"id": 22170,
"option-data": [
{
"always-send": false,
"code": 3,
"csv-format": true,
"data": "192.168.161.121",
"name": "routers",
"space": "dhcp4"
}
],
"pools": [
{
"client-class": "KNOWN",
"option-data": [
],
"pool": "192.168.161.122-192.168.161.126"
}
],
"relay": {
"ip-addresses": [
]
},
"reservations": [
],
"subnet": "192.168.161.120/29"
}
]
}
],
"subnet4": [
],
"t1-percent": 0.5,
"t2-percent": 0.875,
"valid-lifetime": 4000
}
},
"result": 0
}
]
Server startuop log
023 15:44:27.885 kea-dhcp4.hosts HOSTS_BACKENDS_REGISTERED the following host backend types are available: mysql postgresql
023 15:44:27.888 kea-dhcp4.dhcpsrv DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type udp
023 15:44:27.888 kea-dhcp4.dhcpsrv DHCPSRV_CFGMGR_ADD_IFACE listening on interface eth0
023 15:44:27.889 kea-dhcp4.commands COMMAND_ACCEPTOR_START Starting to accept connections via unix domain socket bound to /var/run/kea/socket-v4
023 15:44:27.890 kea-dhcp4.mysql-cb-hooks MYSQL_CB_INIT_OK loading MYSQL CB hooks library successful
023 15:44:27.890 kea-dhcp4.hooks HOOKS_LIBRARY_LOADED hooks library /usr/lib64/kea/hooks/libdhcp_mysql_cb.so successfully loaded
023 15:44:27.891 kea-dhcp4.lease-cmds-hooks LEASE_CMDS_INIT_OK loading Lease Commands hooks library successful
023 15:44:27.891 kea-dhcp4.hooks HOOKS_LIBRARY_LOADED hooks library /usr/lib64/kea/hooks/libdhcp_lease_cmds.so successfully loaded
023 15:44:27.891 kea-dhcp4.dctl DCTL_OPEN_CONFIG_DB Opening configuration database: host=localhost name=kea password=***** port=3306 type=mysql user=kea
023 15:44:27.910 kea-dhcp4.dctl DCTL_CONFIG_FETCH Fetching configuration data from config backends.
023 15:44:27.915 kea-dhcp4.dhcpsrv DHCPSRV_CFGMGR_CONFIG4_MERGED Configuration backend data has been merged.
023 15:44:27.915 kea-dhcp4.dhcp4 DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: added IPv4 subnets: 2; DDNS: disabled
023 15:44:27.915 kea-dhcp4.dhcpsrv DHCPSRV_MYSQL_DB opening MySQL lease database: host=localhost lfc-interval=1800 name=kea_leases password=***** port=3306 reconnect-wait-time=500 type=mysql universe=4 user=kea
023 15:44:27.921 kea-dhcp4.hosts DHCPSRV_MYSQL_HOST_DB opening MySQL hosts database: host=localhost name=kea password=***** port=3306 reconnect-wait-time=500 type=mysql universe=4 user=kea
023 15:44:27.926 kea-dhcp4.dhcp4 DHCP4_STARTED Kea DHCPv4 server version 1.7.3 started
packets.log on debug level 99
023 15:37:04.920 kea-dhcp4.packets DHCP4_BUFFER_RECEIVED received buffer from 192.168.111.65:67 to 192.168.160.8:67 over interface eth0
023 15:37:04.921 kea-dhcp4.packets DHCP4_PACKET_RECEIVED [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: DHCPDISCOVER (type 1) received from 192.168.111.65 to 192.168.160.8 on interface eth0
023 15:37:04.921 kea-dhcp4.packets DHCP4_QUERY_DATA [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079, packet details: local_address=192.168.160.8:67, remote_address=192.168.111.65:67, msg_type=DHCPDISCOVER (1), transid=0xf1d5d079,
options:
type=012, len=009: "AVX5B761E" (string)
type=053, len=001: 1 (uint8)
type=055, len=007: 1(uint8) 28(uint8) 3(uint8) 6(uint8) 15(uint8) 42(uint8) 242(uint8)
type=057, len=002: 576 (uint16)
023 15:37:04.921 kea-dhcp4.packets DHCP4_SUBNET_SELECTED [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: the subnet with ID 22028 was selected for client assignments
023 15:37:04.921 kea-dhcp4.packets DHCP4_SUBNET_DATA [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: the selected subnet details: 192.168.111.64/28
023 15:37:04.922 kea-dhcp4.packets DHCP4_PACKET_SEND [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: trying to send packet DHCPOFFER (type 2) from *:67 to 192.168.111.65:67 on interface eth0
023 15:37:04.922 kea-dhcp4.packets DHCP4_RESPONSE_DATA [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: responding with packet DHCPOFFER (type 2), packet details: local_address=0.0.0.0:67, remote_address=192.168.111.65:67, msg_type=DHCPOFFER (2), transid=0xf1d5d079,
options:
type=001, len=004: 4294967280 (uint32)
type=003, len=004: 192.168.111.65
type=006, len=008: 192.168.134.53 192.168.160.53
type=012, len=009: "avx5b761e" (string)
type=015, len=006: "kmz.ts" (string)
type=051, len=004: 4000 (uint32)
type=053, len=001: 2 (uint8)
type=054, len=004: 192.168.160.8
type=058, len=004: 1000 (uint32)
type=059, len=004: 2000 (uint32)
type=242, len=024: "MCIPADD=192.168.131.133\" (string)
023 15:37:09.919 kea-dhcp4.packets DHCP4_BUFFER_RECEIVED received buffer from 192.168.111.65:67 to 192.168.160.8:67 over interface eth0
023 15:37:09.919 kea-dhcp4.packets DHCP4_PACKET_RECEIVED [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: DHCPDISCOVER (type 1) received from 192.168.111.65 to 192.168.160.8 on interface eth0
023 15:37:09.920 kea-dhcp4.packets DHCP4_QUERY_DATA [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079, packet details: local_address=192.168.160.8:67, remote_address=192.168.111.65:67, msg_type=DHCPDISCOVER (1), transid=0xf1d5d079,
options:
type=012, len=009: "AVX5B761E" (string)
type=053, len=001: 1 (uint8)
type=055, len=007: 1(uint8) 28(uint8) 3(uint8) 6(uint8) 15(uint8) 42(uint8) 242(uint8)
type=057, len=002: 576 (uint16)
023 15:37:09.920 kea-dhcp4.packets DHCP4_SUBNET_SELECTED [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: the subnet with ID 22028 was selected for client assignments
023 15:37:09.920 kea-dhcp4.packets DHCP4_SUBNET_DATA [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: the selected subnet details: 192.168.111.64/28
023 15:37:09.920 kea-dhcp4.packets DHCP4_PACKET_SEND [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: trying to send packet DHCPOFFER (type 2) from *:67 to 192.168.111.65:67 on interface eth0
023 15:37:09.920 kea-dhcp4.packets DHCP4_RESPONSE_DATA [hwtype=1 3c:b1:5b:5b:76:1e], cid=[no info], tid=0xf1d5d079: responding with packet DHCPOFFER (type 2), packet details: local_address=0.0.0.0:67, remote_address=192.168.111.65:67, msg_type=DHCPOFFER (2), transid=0xf1d5d079,
options:
type=001, len=004: 4294967280 (uint32)
type=003, len=004: 192.168.111.65
type=006, len=008: 192.168.134.53 192.168.160.53
type=012, len=009: "avx5b761e" (string)
type=015, len=006: "kmz.ts" (string)
type=051, len=004: 4000 (uint32)
type=053, len=001: 2 (uint8)
type=054, len=004: 192.168.160.8
type=058, len=004: 1000 (uint32)
type=059, len=004: 2000 (uint32)
type=242, len=024: "MCIPADD=192.168.131.133\" (string)
Contacting you email: hedgehog57@gmail.com