]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-link.c
dhcp4: fix DHCP on InfiniBand interfaces
authorTimo Rothenpieler <timo@rothenpieler.org>
Mon, 26 Oct 2020 13:09:13 +0000 (14:09 +0100)
committerTimo Rothenpieler <timo@rothenpieler.org>
Wed, 28 Oct 2020 13:44:43 +0000 (14:44 +0100)
commit14b66dbc92fbae3bd7fc8be4bba476dd1bbb5795
treea607ee8d2528385ef95a1aa3729aaec926950b24
parentb8162cd200c69be509475b8f2184a5ac651fc2b0
dhcp4: fix DHCP on InfiniBand interfaces

With these patches applied, networkd is successfully able to get an
address from a DHCP server on an IPoIB interface.

1)
Makes networkd pass the actual interface type to the dhcp client,
instead of hardcoding it to Ethernet.

2)
Fixes some issues in handling the larger (20 Byte) IB MAC addresses in
the dhcp code.

3)
Add a new field to networkds Link struct, which holds the interface
broadcast address.

3.1)
Modify the DHCP code to also expect the broadcast address as parameter.
On an Ethernet-Interface the Broadcast address never changes and is always
all 6 bytes set to 0xFF.
On an IB one however it is not neccesarily always the same, thus
fetching the actual address from the interface is neccesary.

4)
Only the last 8 bytes of an IB MAC are stable, so when using an IB MAC to
generate a client ID, only pass those 8 bytes.
src/libsystemd-network/dhcp-internal.h
src/libsystemd-network/dhcp-network.c
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/test-dhcp-client.c
src/network/networkd-dhcp4.c
src/network/networkd-dhcp6.c
src/network/networkd-link.c
src/network/networkd-link.h
src/systemd/sd-dhcp-client.h