summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-10-15 21:46:27 +0200
committerGitHub <noreply@github.com>2021-10-15 21:46:27 +0200
commita98efc300c45cbfdd9b5c34561737909a77ecb22 (patch)
tree4a543162ccac34f13d82a94448212422e185a97c
parent29c57102b78ff40bec1ece214a78d5a1b6953895 (diff)
parent70836c5adb4e51bf46f79700b57b9a1437776793 (diff)
downloadvyos-1x-a98efc300c45cbfdd9b5c34561737909a77ecb22.tar.gz
vyos-1x-a98efc300c45cbfdd9b5c34561737909a77ecb22.zip
Merge pull request #1026 from sever-sever/T3832
dhclient: T3832: Add hexadecimal format for client-id
-rw-r--r--data/templates/dhcp-client/ipv4.tmpl7
1 files changed, 6 insertions, 1 deletions
diff --git a/data/templates/dhcp-client/ipv4.tmpl b/data/templates/dhcp-client/ipv4.tmpl
index c934b7cdb..11e961166 100644
--- a/data/templates/dhcp-client/ipv4.tmpl
+++ b/data/templates/dhcp-client/ipv4.tmpl
@@ -7,7 +7,12 @@ retry 300;
interface "{{ ifname }}" {
send host-name "{{ dhcp_options.host_name }}";
{% if dhcp_options.client_id is defined and dhcp_options.client_id is not none %}
- send dhcp-client-identifier "{{ dhcp_options.client_id }}";
+{% set client_id = dhcp_options.client_id %}
+{# Use HEX representation of client-id as it is send in MAC-address style using hex characters. If not HEX, use double quotes ASCII format #}
+{% if not dhcp_options.client_id.split(':') | length >= 5 %}
+{% set client_id = '"' + dhcp_options.client_id + '"' %}
+{% endif %}
+ send dhcp-client-identifier {{ client_id }};
{% endif %}
{% if dhcp_options.vendor_class_id is defined and dhcp_options.vendor_class_id is not none %}
send vendor-class-identifier "{{ dhcp_options.vendor_class_id }}";