Netdev Archive on
help / color / mirror / Atom feed
* Question about dev_validate_header used in af_packet.c
@ 2020-09-05 22:24 Xie He
  2020-09-05 23:20 ` Xie He
  0 siblings, 1 reply; 9+ messages in thread
From: Xie He @ 2020-09-05 22:24 UTC (permalink / raw)
  To: Willem de Bruijn, Eric Dumazet, David S. Miller, Jakub Kicinski,
	Linux Kernel Network Developers, LKML

Hi Willem,

I have a question about the function dev_validate_header used in
af_packet.c. Can you help me? Thanks!

I see when the length of the data is smaller than hard_header_len, and
when the user is "capable" enough, the function will accept it and pad
it with 0s, without validating the header with header_ops->validate.

But I think if the driver is able to accept variable-length LL
headers, shouldn't we just pass the data to header_ops->validate and
let it check the header's validity, and then just pass the validated
data to the driver for transmission?

Why when the user is "capable" enough, can it bypass the
header_ops->validate check? And why do we need to pad the data with
0s? Won't this make the driver confused about the real length of the

Thank you for your help!


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-08 17:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-05 22:24 Question about dev_validate_header used in af_packet.c Xie He
2020-09-05 23:20 ` Xie He
2020-09-07  9:05   ` Willem de Bruijn
2020-09-07 21:16     ` Xie He
2020-09-08  8:40       ` Willem de Bruijn
2020-09-08 11:00         ` Xie He
2020-09-08 11:52           ` Willem de Bruijn
2020-09-08 12:45             ` Xie He
2020-09-08 17:08               ` Willem de Bruijn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).