mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
net: introduce device min_header_len
The stack must not pass packets to device drivers that are shorter
than the minimum link layer header length.
Previously, packet sockets would drop packets smaller than or equal
to dev->hard_header_len, but this has false positives. Zero length
payload is used over Ethernet. Other link layer protocols support
variable length headers. Support for validation of these protocols
removed the min length check for all protocols.
Introduce an explicit dev->min_header_len parameter and drop all
packets below this value. Initially, set it to non-zero only for
Ethernet and loopback. Other protocols can follow in a patch to
net-next.
Fixes: 9ed988cd59
("packet: validate variable length ll headers")
Reported-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d7426c69a1
commit
217e6fa24c
3 changed files with 6 additions and 0 deletions
|
@ -356,6 +356,7 @@ void ether_setup(struct net_device *dev)
|
|||
dev->header_ops = ð_header_ops;
|
||||
dev->type = ARPHRD_ETHER;
|
||||
dev->hard_header_len = ETH_HLEN;
|
||||
dev->min_header_len = ETH_HLEN;
|
||||
dev->mtu = ETH_DATA_LEN;
|
||||
dev->min_mtu = ETH_MIN_MTU;
|
||||
dev->max_mtu = ETH_DATA_LEN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue