• William Tu's avatar
    erspan: auto detect truncated packets. · 1baf5ebf
    William Tu authored
    Currently the truncated bit is set only when the mirrored packet
    is larger than mtu.  For certain cases, the packet might already
    been truncated before sending to the erspan tunnel.  In this case,
    the patch detect whether the IP header's total length is larger
    than the actual skb->len.  If true, this indicated that the
    mirrored packet is truncated and set the erspan truncate bit.
    
    I tested the patch using bpf_skb_change_tail helper function to
    shrink the packet size and send to erspan tunnel.
    Reported-by: default avatarXiaoyan Jin <xiaoyanj@vmware.com>
    Signed-off-by: default avatarWilliam Tu <u9012063@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1baf5ebf
ip_gre.c 44.6 KB