Skip to content
  • Beniamino Galvani's avatar
    dhcp: dhclient: set type 0 for printable client IDs · 8ffa22d1
    Beniamino Galvani authored
    The documentation for the ipv4.dhcp-client-id property says:
    
     If the property is not a hex string it is considered as a
     non-hardware-address client ID and the 'type' field is set to 0.
    
    However, currently we set the client-id without the leading zero byte
    in the dhclient configuration and thus dhclient sends the first string
    character as type and the remainder as client-id content. Looking
    through git history, the dhclient plugin has always behaved this way
    even if the intent was clearly that string client-id had to be zero
    padded (this is evident by looking at
    nm_dhcp_utils_client_id_string_to_bytes()). The internal plugin
    instead sends the correct client-id with zero type.
    
    Change the dhclient plugin to honor the documented behavior and add
    the leading zero byte when the client-id is a string.
    
    This commit introduces a change in behavior for users that have
    dhcp=dhclient and have a plain string (not hexadecimal) set in
    ipv4.dhcp-client-id, as NM will send a different client-id possibly
    changing the IP address returned by the server.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793957
    8ffa22d1
To find the state of this project's repository at the time of any of these versions, check out the tags.