DRAFT: Using Linux BPF Filter in DHCP Client - Blog of Gris

DRAFT: Using Linux BPF Filter in DHCP Client - Blog of Gris

Blog of Gris
During DHCP discovery process, the DHCP network flow is based on UDP when lower IP stack is not ready yet. The user space DHCP client program will need ethernet RAW socket(AF_PACKET, SOCK_RAW) to receive UDP package otherwise kernel will drop the UDP package as IP mismatch.Hooking on Ethernet RAW socket requires DHCP client filter out non-DHCP network package in user space which could result a large CPU overhead. The Linux kernel is providing BPF (Berkeley Packet Filter) facility for filtering packages in kernel space before sending to user space.

本文章由 flowerss 抓取自RSS,版权归源站点所有。

查看原文:DRAFT: Using Linux BPF Filter in DHCP Client - Blog of Gris

Report Page