lkml.org 
[lkml]   [2020]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 23/97] hsr: reset network header when supervision frame is created
    Date
    From: Taehee Yoo <ap420073@gmail.com>

    commit 3ed0a1d563903bdb4b4c36c58c4d9c1bcb23a6e6 upstream.

    The supervision frame is L2 frame.
    When supervision frame is created, hsr module doesn't set network header.
    If tap routine is enabled, dev_queue_xmit_nit() is called and it checks
    network_header. If network_header pointer wasn't set(or invalid),
    it resets network_header and warns.
    In order to avoid unnecessary warning message, resetting network_header
    is needed.

    Test commands:
    ip netns add nst
    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 nst
    ip link set veth0 up
    ip link set veth2 up
    ip link add hsr0 type hsr slave1 veth0 slave2 veth2
    ip a a 192.168.100.1/24 dev hsr0
    ip link set hsr0 up
    ip netns exec nst ip link set veth1 up
    ip netns exec nst ip link set veth3 up
    ip netns exec nst ip link add hsr1 type hsr slave1 veth1 slave2 veth3
    ip netns exec nst ip a a 192.168.100.2/24 dev hsr1
    ip netns exec nst ip link set hsr1 up
    tcpdump -nei veth0

    Splat looks like:
    [ 175.852292][ C3] protocol 88fb is buggy, dev veth0

    Fixes: f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)")
    Signed-off-by: Taehee Yoo <ap420073@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    net/hsr/hsr_device.c | 2 ++
    1 file changed, 2 insertions(+)

    --- a/net/hsr/hsr_device.c
    +++ b/net/hsr/hsr_device.c
    @@ -281,6 +281,8 @@ static void send_hsr_supervision_frame(s
    skb->dev->dev_addr, skb->len) <= 0)
    goto out;
    skb_reset_mac_header(skb);
    + skb_reset_network_header(skb);
    + skb_reset_transport_header(skb);

    if (hsrVer > 0) {
    hsr_tag = (typeof(hsr_tag)) skb_put(skb, sizeof(struct hsr_tag));

    \
     
     \ /
      Last update: 2020-01-22 10:34    [W:3.154 / U:1.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site