]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
net: hsr: Reset MAC header for Tx path
authorKurt Kanzenbach <kurt@linutronix.de>
Tue, 6 Apr 2021 07:35:09 +0000 (09:35 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:53:27 +0000 (09:53 +0200)
commit2a13724a96ade275dd792f1c25b26560f9ff23b7
tree2d0cae91b453f7da849ad4178cb62a9db24eacb3
parent1da6d2179ed371dac21c2e45d5def4b47832b51d
net: hsr: Reset MAC header for Tx path

BugLink: https://bugs.launchpad.net/bugs/1926368
commit 9d6803921a16f4d768dc41a75375629828f4d91e upstream.

Reset MAC header in HSR Tx path. This is needed, because direct packet
transmission, e.g. by specifying PACKET_QDISC_BYPASS does not reset the MAC
header.

This has been observed using the following setup:

|$ ip link add name hsr0 type hsr slave1 lan0 slave2 lan1 supervision 45 version 1
|$ ifconfig hsr0 up
|$ ./test hsr0

The test binary is using mmap'ed sockets and is specifying the
PACKET_QDISC_BYPASS socket option.

This patch resolves the following warning on a non-patched kernel:

|[  112.725394] ------------[ cut here ]------------
|[  112.731418] WARNING: CPU: 1 PID: 257 at net/hsr/hsr_forward.c:560 hsr_forward_skb+0x484/0x568
|[  112.739962] net/hsr/hsr_forward.c:560: Malformed frame (port_src hsr0)

The warning can be safely removed, because the other call sites of
hsr_forward_skb() make sure that the skb is prepared correctly.

Fixes: d346a3fae3ff ("packet: introduce PACKET_QDISC_BYPASS socket option")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/hsr/hsr_device.c
net/hsr/hsr_forward.c