Systemd/src/libsystemd-network
Thomas Haller 13f1fd0376 dhcp: ignore padding of 'chaddr' in DHCP server response
The "chaddr" field is 16 bytes long, with "hlen" being the
length of the address.

https://tools.ietf.org/html/rfc2131#section-4.3.1 says:

    The server MUST return to the client:

    ...

    o Any parameters specific to this client (as identified by
      the contents of 'chaddr' or 'client identifier' in the DHCPDISCOVER
      or DHCPREQUEST message), e.g., as configured by the network
      administrator,

It's not clear, whether only the first 'hlen' bytes of 'chaddr'
must correspond or all 16 bytes.

Note that https://tools.ietf.org/html/rfc4390#section-2.1 says for IPoIB

    "chaddr" (client hardware address) field MUST be zeroed.

with having "hlen" zero. This indicates that at least in this case, the
bytes after "hlen" would matter.

As the DHCP client always sets the trailing bytes to zero, we would expect
that the server also replies as such and we could just compare all 16 bytes.
However, let's be liberal and accept any padding here.

This in practice only changes behavior for infiniband, where we
previously would enforce that the first ETH_ALEN bytes are zero.
That seems arbitrary for IPoIB. We should either check all bytes or
none of them. Let's do the latter and don't enforce RFC 4390 in this
regard.
2019-02-15 11:41:06 +01:00
..
arp-util.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
arp-util.h tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
dhcp-identifier.c dhcp/trivial: fix spelling error in comment 2019-01-25 20:29:39 +09:00
dhcp-identifier.h dhcp6: don't enforce DUID content for sd_dhcp6_client_set_duid() 2018-12-20 13:40:39 +01:00
dhcp-internal.h tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
dhcp-lease-internal.h tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
dhcp-network.c dhcp: ignore padding of 'chaddr' in DHCP server response 2019-02-15 11:41:06 +01:00
dhcp-option.c tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
dhcp-packet.c coccinelle: make use of SYNTHETIC_ERRNO 2018-11-22 10:54:38 +01:00
dhcp-protocol.h tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
dhcp-server-internal.h tree-wide: make hash_ops typesafe 2018-12-02 07:53:27 +01:00
dhcp6-internal.h dhcp6: constify things where we can 2018-10-25 11:23:19 +02:00
dhcp6-lease-internal.h dhcp6-client: Store lease timeouts T1 and T1 in client struct 2018-09-19 13:45:18 -06:00
dhcp6-network.c tree-wide: introduce setsockopt_int() helper and make use of it everywhere 2018-10-18 19:50:29 +02:00
dhcp6-option.c dhcp6: prefer offsetof() over sizeof() for structs with undefined sizes 2018-10-25 11:23:19 +02:00
dhcp6-protocol.h tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
icmp6-util.c tree-wide: use IOVEC_MAKE() at many places 2018-11-27 10:12:27 +01:00
icmp6-util.h tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
lldp-internal.h lldp: improve debug log message 2018-11-06 20:15:09 +09:00
lldp-neighbor.c Use c99 static array size declarations in exported functions too 2019-01-04 12:37:25 +01:00
lldp-neighbor.h lldp: rename lldp_neighbor_id_hash_ops and set value destructor 2018-12-02 12:18:54 +01:00
lldp-network.c util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
lldp-network.h tree-wide: drop double newline 2018-06-29 11:02:17 +09:00
meson.build Drop my copyright headers 2018-06-14 13:03:20 +02:00
ndisc-internal.h ndisc: improve debug log message 2018-11-06 20:15:09 +09:00
ndisc-router.c resolve: reject host names with leading or trailing dashes in /etc/hosts 2018-12-10 09:56:56 +01:00
ndisc-router.h tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
network-internal.c Merge pull request #11382 from keszybz/udev-predictable-macs 2019-02-15 11:31:25 +01:00
network-internal.h network: fix handling of uninitialized and zero IAID setting 2018-12-10 14:25:28 +01:00
radv-internal.h libsystemd-network: remove _packed_ attribute to appease the compiler 2019-02-04 20:32:44 +01:00
sd-dhcp-client.c dhcp: ignore padding of 'chaddr' in DHCP server response 2019-02-15 11:41:06 +01:00
sd-dhcp-lease.c resolve: reject host names with leading or trailing dashes in /etc/hosts 2018-12-10 09:56:56 +01:00
sd-dhcp-server.c dhcp: introduce dhcp_lease_hash_ops and use it 2018-12-02 12:17:28 +01:00
sd-dhcp6-client.c dhcp6: don't enforce DUID content for sd_dhcp6_client_set_duid() 2018-12-20 13:40:39 +01:00
sd-dhcp6-lease.c sd-dhcp6: do not update serverid when ENOMEM 2018-10-19 06:11:58 +09:00
sd-ipv4acd.c ipv4acd: do not unref() event sources when update or disable them 2018-11-16 22:57:42 +09:00
sd-ipv4ll.c tree-wide: use DEFINE_TRIVIAL_REF_UNREF_FUNC() macro or friends where applicable 2018-08-27 14:01:46 +09:00
sd-lldp.c util: drop missing.h from socket-util.h 2018-12-06 13:31:16 +01:00
sd-ndisc.c Delete duplicate lines 2019-01-12 16:02:26 +01:00
sd-radv.c networkd: refuse IPv6 RADV prefixes that lack Prefix= setting 2018-11-30 22:19:28 +01:00
test-acd.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-dhcp-client.c dhcp: support endianness independent dhcp_identifier_set_iaid() 2018-11-12 19:08:35 +01:00
test-dhcp-option.c Merge pull request #2589 from keszybz/resolve-tool-2 2016-02-13 11:15:41 +01:00
test-dhcp-server.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-dhcp6-client.c util: drop missing.h from socket-util.h 2018-12-06 13:31:16 +01:00
test-ipv4ll-manual.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-ipv4ll.c libsystemd-network: set SOCK_CLOEXEC and SOCK_NONBLOCK 2018-11-12 02:03:22 +09:00
test-lldp.c lldp: add 802.3 OUI subtype definitions 2018-12-21 17:30:01 +01:00
test-ndisc-ra.c libsystemd-network: set SOCK_CLOEXEC and SOCK_NONBLOCK 2018-11-12 02:03:22 +09:00
test-ndisc-rs.c libsystemd-network: set SOCK_CLOEXEC and SOCK_NONBLOCK 2018-11-12 02:03:22 +09:00
test-sd-dhcp-lease.c network: Implement DHCP Option 119 (Domain Search List) (#5932) 2017-05-13 10:19:32 -04:00