Skip to content

Add lpf IPoIB support

Timo Rothenpieler requested to merge TimoRoth/kea:ib_filtering into master

This adds support for Serving an IPoIB network on Linux via raw sockets and lpf. I have this code in use on our cluster with multiple net-booting IPoIB clients, and have yet to run into issues.

Support is basically added in 3 steps:

First, IPoIB does not have one fixed broadcast address, but it varies per network. So infrastructure is added to query the L2 broadcast address from the Interface. Second, the actual lpf filtering support for an IPoIB interface is added. This is basically a second set of BPF rules that are similar but not identical to the regular Ethernet ones. And finally, a few smaller functional differences are dealt with. Like, the potential lack of a valid L2 address to reply to, in which case a broadcast becomes neccesary, or the too large hardware address that needs converted for the DHCP packet.

Specially the later part goes technically against the RFC, which calls for a zeroed out chaddr with a length of 0. However, when I did that, both the EDK2 netboot client as well as dhclient failed. And both of those also ignore that part of the RFC, and send something, though both send something different, which makes writing static host-entries rather annoying. systemd-networkd also does not zero out chaddr, and sends the last 8 byte of the ib hwaddr instead, which I decided to do as well. This part of the hwaddr contains the actual per-device part, so is unique for every device.

References: #3473 https://github.com/isc-projects/kea/pull/134

Merge request reports