Thread (39 messages) 39 messages, 6 authors, 4d ago

Re: [PATCH net-next v2 6/7] net: add ip4_parse()

flat view

From: Björn Töpel <bjorn@kernel.org>
Date: 2026-10-16 11:56:15
Also in: bridge, lkml, netfilter-devel, virtualization

"Michael S. Tsirkin" [off-list ref] writes:
Multiple places in the net stack open-code the same minimal IPv4 header
validation: pull the fixed header, check version 4 and IHL >= 5 (where 5
is the fixed header size in 32-bit units) - and locate the transport
header at IHL * 4 past the network header.

Add a helper for doing that: it returns the validated header and
the transport header offset, or NULL if truncated or malformed.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Assisted-by: LLM
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help