[ovs-dev] [PATCH v3] datapath: make skb->csum consistent with rest of networking stack.

Jesse Gross jesse at nicira.com
Tue Jun 11 23:16:55 UTC 2013


On Tue, Jun 11, 2013 at 3:54 PM, Pravin B Shelar <pshelar at nicira.com> wrote:
> diff --git a/datapath/actions.c b/datapath/actions.c
> index 0dac658..f9da8a4 100644
> --- a/datapath/actions.c
> +++ b/datapath/actions.c
> @@ -132,9 +132,17 @@ static int set_eth_addr(struct sk_buff *skb,
>         if (unlikely(err))
>                 return err;
>
> +       if (get_ip_summed(skb) == OVS_CSUM_COMPLETE)
> +               skb->csum = csum_sub(skb->csum, csum_partial(eth_hdr(skb),
> +                                                            ETH_ALEN, 0));
> +
>         memcpy(eth_hdr(skb)->h_source, eth_key->eth_src, ETH_ALEN);
>         memcpy(eth_hdr(skb)->h_dest, eth_key->eth_dst, ETH_ALEN);
>
> +       if (get_ip_summed(skb) == OVS_CSUM_COMPLETE)
> +               skb->csum = csum_add(skb->csum, csum_partial(eth_hdr(skb),
> +                                                            ETH_ALEN, 0));
> +

Doesn't this need to be 2 * ETH_ALEN?



More information about the dev mailing list