• Wei Liu's avatar
    xen-netfront: reset skb network header before checksum · d554f73d
    Wei Liu authored
    In ed1f50c3 ("net: add skb_checksum_setup") we introduced some checksum
    functions in core driver. Subsequent change b5cf66cd ("xen-netfront:
    use new skb_checksum_setup function") made use of those functions to
    replace its own implementation.
    
    However with that change netfront is broken. It sees a lot of checksum
    error. That's because its own implementation of checksum function was a
    bit hacky (dereferencing skb->data directly) while the new function was
    implemented using ip_hdr(). The network header is not reset before skb
    is passed to the new function. When the new function tries to do its
    job, it's confused and reports error.
    
    The fix is simple, we need to reset network header before passing skb to
    checksum function. Netback is not affected as it already does the right
    thing.
    Reported-by: default avatarSander Eikelenboom <linux@eikelenboom.it>
    Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Paul Durrant <paul.durrant@citrix.com>
    Tested-By: default avatarSander Eikelenboom <linux@eikelenboom.it>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d554f73d
xen-netfront.c 51.5 KB