The DHCP relay is designed to use interfaces with L2 headers. Add following support so that it can work on interfaces without L2 headers:
-
Handle sa_family == ARPHRD_NONE in get_hw_addr();
-
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);
-
Avoid assembling / decoding L2 headers when sending / receiving L2 packets
-
Adjust the BPF filter code to skip over analysing L2 headers
Signed-off-by: Qingtao Cao qingtao.cao@digi.com
Closes #152