Rollback popped innermost headers?
Morten Brørup
mb at smartsharesystems.com
Thu May 28 21:29:37 CEST 2026
> From: Morten Brørup
> Sent: Thursday, 28 May 2026 13.05
>
> When the built-in DHCP client is disabled, packets to UDP port 68
> (IPPORT_BOOTPC) are forwarded to the control plane.
>
> I noticed that Ethernet addresses in the L2 header are not copied from
> the original packet:
> https://github.com/DPDK/grout/blob/main/modules/dhcp/datapath/dhcp_inpu
> t.c#L101
>
> There may be outer headers (if the DHCP packet ingressed on a tunnel
> interface), so the Ethernet addresses should come from the innermost L2
> header.
>
> Is it impossible to unpop / roll back the L3 and L2 headers that were
> popped from the mbuf?
Self answering, after having examined more details...
Maybe not impossible, but it would be an ugly hack.
rte_pktmbuf_prepend() is prohibited, and gr_mbuf_prepend() is clearly designed for adding a new header, not for un-popping previously popped headers.
But it is not needed:
The BOOTP RFC describes the protocol as operating on top of UDP.
So discarding the lower layer (L2 and L3) headers is correct.
Grout only appends an Ethernet and IP header because the TAP interface requires them.
On the other side of the TAP interface, it should be passed up through the IP stack to the DHCP client application.
For that to succeed, the headers only need to be present and valid. Whatever was in the original headers (that were removed by Grout before reaching its dhcp processor) doesn't matter.
>
>
> I assume any packet to UDP port 68 will end up in dhcp_input_process,
> even if it ingressed on a non-Ethernet interface.
>
> Would it possible to identify the type of the interface that forwarded
> the packet to dhcp_input_process?
> Then, for interface types with Ethernet headers (Ethernet interfaces,
> Bond interfaces, Tunneled Ethernet interfaces, etc.), the original
> Ethernet addresses could be copied into the packet forwarded to the
> control plane.
Also no need for this.
The DHCP client is an application running on top of UDP.
An interesting exercise in layer traversal. ;-)
Sorry about the noise.
Just playing around with various corners of Grout to get acquainted with it.
Hopefully other Grout newcomers can learn from my silly questions. :-)
-Morten
More information about the grout
mailing list