macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops
authorZhengchao Shao <shaozhengchao@huawei.com>
Sat, 2 Dec 2023 13:06:58 +0000 (21:06 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 5 Dec 2023 12:41:48 +0000 (13:41 +0100)
commitcb297cc5e194a2ea3cb8aaf722005286ee42b011
tree7a5ab32609cb8249cadd12e6ef82f8679dab19d2
parent76ca21676533736323f08367660ef9f816d60a13
macvlan: implement .parse_protocol hook function in macvlan_hard_header_ops

The .parse_protocol hook function in the macvlan_header_ops structure is
not implemented. As a result, when the AF_PACKET family is used to send
packets, skb->protocol will be set to 0.
Macvlan is a device of type ARPHRD_ETHER (ether_setup). Therefore, use
eth_header_parse_protocol function to obtain the protocol.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20231202130658.2266526-1-shaozhengchao@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/macvlan.c