dhcp: client use mac address as client identifier 43/41743/3
authorOle Troan <[email protected]>
Wed, 23 Oct 2024 19:13:19 +0000 (21:13 +0200)
committerDamjan Marion <[email protected]>
Fri, 25 Oct 2024 09:33:03 +0000 (09:33 +0000)
Previously the DHCP client use a constant client identifier (vpp 1.1).
Problem with that is that multiple VPP clients on the same link would
fail. Fixed by using MAC address instead.

Type: improvement
Change-Id: If37f4a14cc728bde6c9ef6c169957562d763c973
Signed-off-by: Ole Troan <[email protected]>
src/plugins/dhcp/client.c

index 8fa67c6..d81d293 100644 (file)
@@ -1153,7 +1153,9 @@ dhcp_client_set_command_fn (vlib_main_t * vm,
   a->is_add = is_add;
   a->sw_if_index = sw_if_index;
   a->hostname = hostname;
-  a->client_identifier = format (0, "vpp 1.1%c", 0);
+  a->client_identifier =
+    format (0, "%U", format_ethernet_address,
+           vnet_sw_interface_get_hw_address (vnet_get_main (), sw_if_index));
   a->set_broadcast_flag = set_broadcast_flag;
 
   /*