Skip to content

Support dhcrelay on interfaces with zero MAC address

The DHCP relay is designed to use interfaces with L2 headers. Add following support so that it can work on interfaces without L2 headers:

  1. Handle sa_family == ARPHRD_NONE in get_hw_addr();

  2. Use the Linux cooked socket instead of raw socket so that a copy of L4 / protocol handled packet can be reinjected to the PF_PACKET taps (this is critical when the DHCP relay doesn't understand the L2 packets captured, for example, when they are encrypted IPSec packets);

  3. Avoid assembling / decoding L2 headers when sending / receiving L2 packets

  4. Adjust the BPF filter code to skip over analysing L2 headers

Signed-off-by: Qingtao Cao

Closes #152

Merge request reports