]> git.baikalelectronics.ru Git - kernel.git/commit
net: rmnet: fix packet forwarding in rmnet bridge mode
authorTaehee Yoo <ap420073@gmail.com>
Thu, 27 Feb 2020 12:26:15 +0000 (12:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Feb 2020 19:45:07 +0000 (11:45 -0800)
commitc881cb63701864872c36435dc28c1e33a22708ed
treebf4be7bd700ab44340fb4378717c52ca9e5f37e4
parent731ad4f275ab23bede8b5b2195c078a331bdf44b
net: rmnet: fix packet forwarding in rmnet bridge mode

Packet forwarding is not working in rmnet bridge mode.
Because when a packet is forwarded, skb_push() for an ethernet header
is needed. But it doesn't call skb_push().
So, the ethernet header will be lost.

Test commands:
    modprobe rmnet
    ip netns add nst
    ip netns add nst2
    ip link add veth0 type veth peer name veth1
    ip link add veth2 type veth peer name veth3
    ip link set veth1 netns nst
    ip link set veth3 netns nst2

    ip link add rmnet0 link veth0 type rmnet mux_id 1
    ip link set veth2 master rmnet0
    ip link set veth0 up
    ip link set veth2 up
    ip link set rmnet0 up
    ip a a 192.168.100.1/24 dev rmnet0

    ip netns exec nst ip link set veth1 up
    ip netns exec nst ip a a 192.168.100.2/24 dev veth1
    ip netns exec nst2 ip link set veth3 up
    ip netns exec nst2 ip a a 192.168.100.3/24 dev veth3
    ip netns exec nst2 ping 192.168.100.2

Fixes: 3228db8ccf72 ("net: qualcomm: rmnet: Implement bridge mode")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c