NetworkManager/src/dhcp
Thomas Haller 7efc3c479f dhcp: truncate client-id for n-dhcp4 client at arbitrary limit
RFC does not define how long the client ID can be. However,
n-dhcp4 enforces that the server replies with a client ID that
matches the request. Also, the client ID gets encoded as a DHCP
option, hence it cannot be longer than 255 bytes.

While n-dhcp4 doesn't enforce a certain length, a too long client
ID is not going to work. Hence, truncate it at 133 bytes.

This is the same limit that also systemd's DHCP client has. It's chosen
to fit an RFC4361-complient client ID with a DUID of length
MAX_DUID_LEN (which is 128 bytes according to RFC 3315 section 9.1).

Fixes-test: @ipv4_set_very_long_dhcp_client_id

See-also: https://github.com/nettools/n-dhcp4/pull/6

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/307
2019-10-23 14:58:13 +02:00
..
tests dhcp: include conditionals from existing dhclient configuration 2019-10-10 14:47:21 +02:00
meson.build meson: Rename the compiler flags variable 2019-10-01 09:49:33 +02:00
nm-dhcp-client-logging.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-client.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-client.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-dhclient-utils.c dhcp: include conditionals from existing dhclient configuration 2019-10-10 14:47:21 +02:00
nm-dhcp-dhclient-utils.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-dhclient.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-dhcpcanon.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-dhcpcd.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-helper-api.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp-helper.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-listener.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp-listener.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp-manager.c dhcp: ignore hostname when invalid 2019-10-17 18:05:20 +02:00
nm-dhcp-manager.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-nettools.c dhcp: truncate client-id for n-dhcp4 client at arbitrary limit 2019-10-23 14:58:13 +02:00
nm-dhcp-options.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp-options.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp-systemd.c dhcp: systemd: support DHCPv6 prefix delegation 2019-09-30 16:15:13 +02:00
nm-dhcp-utils.c all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-dhcp-utils.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00