mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
openvswitch: use flow protocol when recalculating ipv6 checksums
[ Upstream commitb4f70527f0] When using masked actions the ipv6_proto field of an action to set IPv6 fields may be zero rather than the prevailing protocol which will result in skipping checksum recalculation. This patch resolves the problem by relying on the protocol in the flow key rather than that in the set field action. Fixes:83d2b9ba1a("net: openvswitch: Support masked set actions.") Cc: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b5c9a73c50
commit
2a33f756ae
@@ -461,7 +461,7 @@ static int set_ipv6(struct sk_buff *skb, struct sw_flow_key *flow_key,
|
||||
mask_ipv6_addr(saddr, key->ipv6_src, mask->ipv6_src, masked);
|
||||
|
||||
if (unlikely(memcmp(saddr, masked, sizeof(masked)))) {
|
||||
set_ipv6_addr(skb, key->ipv6_proto, saddr, masked,
|
||||
set_ipv6_addr(skb, flow_key->ip.proto, saddr, masked,
|
||||
true);
|
||||
memcpy(&flow_key->ipv6.addr.src, masked,
|
||||
sizeof(flow_key->ipv6.addr.src));
|
||||
@@ -483,7 +483,7 @@ static int set_ipv6(struct sk_buff *skb, struct sw_flow_key *flow_key,
|
||||
NULL, &flags)
|
||||
!= NEXTHDR_ROUTING);
|
||||
|
||||
set_ipv6_addr(skb, key->ipv6_proto, daddr, masked,
|
||||
set_ipv6_addr(skb, flow_key->ip.proto, daddr, masked,
|
||||
recalc_csum);
|
||||
memcpy(&flow_key->ipv6.addr.dst, masked,
|
||||
sizeof(flow_key->ipv6.addr.dst));
|
||||
|
||||
Reference in New Issue
Block a user