diff options
| author | Patrick Elsen <[email protected]> | 2020-01-14 23:02:26 +0100 |
|---|---|---|
| committer | adoyle <[email protected]> | 2020-03-18 20:12:35 +0000 |
| commit | 7667fb6b16dfdc2f904d100787cb4501d5f6df3f (patch) | |
| tree | 4c682ac9638a5612fe0fd556666de5eabe7496f3 /rootconf/default | |
| parent | 9c6e505c732b53dc2c761bc06f37e46aa1656cb3 (diff) | |
Add client ID (option 61) to udhcp parameters.
Sends the serial number of the device in the DHCP packet as option 61,
formatted as a hex converted ASCII string
(Client ID).
Closes: #697
Signed-off-by: Alex Doyle <[email protected]>
Signed-off-by: Patrick Elsen <[email protected]>
Diffstat (limited to 'rootconf/default')
| -rw-r--r-- | rootconf/default/lib/onie/functions | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rootconf/default/lib/onie/functions b/rootconf/default/lib/onie/functions index 516a8d34..28eccb6d 100644 --- a/rootconf/default/lib/onie/functions +++ b/rootconf/default/lib/onie/functions @@ -401,6 +401,8 @@ udhcpc_args() local udhcp_args="-q -S -V onie_vendor:${onie_platform}" # user_class - option 77 - string in hex local udhcp_user_class="-x 77:$(str2hex onie_dhcp_user_class)" + # client id - option 61 - serial number in hex + local udhcp_client_id="-x 61:00$(str2hex $(onie-sysinfo -s))" # vendor specific options - option 125 - string in hex # code 3 - machine # code 4 - CPU architecture @@ -411,7 +413,7 @@ udhcpc_args() local payload="${udhcp_vivso_machine}${udhcp_vivso_arch}${udhcp_vivso_machine_rev}" local len=$(( ${#payload} / 2 )) local udhcp_vivso="-x 125:$(printf %08X%02X%s $onie_iana_enterprise $len $payload)" - echo "$udhcp_args" "$udhcp_user_class" "$udhcp_vivso" + echo "$udhcp_args" "$udhcp_user_class" "$udhcp_client_id" "$udhcp_vivso" } # Increment a MAC address by the specified integer |
