On Mon, 14 Feb 2022 14:48:51 +0200 Paul Blakey wrote:
> Ipv6 ttl, label and tos fields are modified without first
> pulling/pushing the ipv6 header, which would have updated
> the hw csum (if available). This might cause csum validation
> when sending the packet to the stack, as can be seen in
> the trace below.
>
> Fix this by updating skb->csum if available.
> Fixes: 3fdbd1ce11e5 ("openvswitch: add ipv6 'set' action")
> Signed-off-by: Paul Blakey <[email protected]>
> ---
> Changelog:
> v1->v2:
> Replaced push pull rcsum checksum calc with actual checksum calc
Well, what I had in mind was an skb helper which would take skb, u32
new_val, u32 old_val, but this works, too.
Please fix the new sparse warnings tho, and..
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index 076774034bb9..3725801cb040 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -423,12 +423,44 @@ static void set_ipv6_addr(struct sk_buff *skb, u8
> l4_proto,
> memcpy(addr, new_addr, sizeof(__be32[4]));
> }
>
> -static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask)
> +static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, __u8
> ipv6_tclass, __u8 mask)
> {
> + __u8 old_ipv6_tclass = ipv6_get_dsfield(nh);
use normal u8, __u8 is for uAPI.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev