diff options
author | Zhengchao Shao <shaozhengchao@huawei.com> | 2023-12-02 14:06:58 +0100 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-12-05 13:41:48 +0100 |
commit | cb297cc5e194a2ea3cb8aaf722005286ee42b011 (patch) | |
tree | 7a5ab32609cb8249cadd12e6ef82f8679dab19d2 | |
parent | Merge branch 'conver-net-selftests-to-run-in-unique-namespace-part-1' (diff) | |
download | linux-cb297cc5e194a2ea3cb8aaf722005286ee42b011.tar.xz linux-cb297cc5e194a2ea3cb8aaf722005286ee42b011.zip |
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>
-rw-r--r-- | drivers/net/macvlan.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 88dd8a2245b0..a3cc665757e8 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -609,6 +609,7 @@ static const struct header_ops macvlan_hard_header_ops = { .parse = eth_header_parse, .cache = eth_header_cache, .cache_update = eth_header_cache_update, + .parse_protocol = eth_header_parse_protocol, }; static int macvlan_open(struct net_device *dev) |