aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch/actions.c')
-rw-r--r--net/openvswitch/actions.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 4e05ea1c2d11..764fdc39c63b 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -281,11 +281,11 @@ static void update_ipv6_checksum(struct sk_buff *skb, u8 l4_proto,
281{ 281{
282 int transport_len = skb->len - skb_transport_offset(skb); 282 int transport_len = skb->len - skb_transport_offset(skb);
283 283
284 if (l4_proto == IPPROTO_TCP) { 284 if (l4_proto == NEXTHDR_TCP) {
285 if (likely(transport_len >= sizeof(struct tcphdr))) 285 if (likely(transport_len >= sizeof(struct tcphdr)))
286 inet_proto_csum_replace16(&tcp_hdr(skb)->check, skb, 286 inet_proto_csum_replace16(&tcp_hdr(skb)->check, skb,
287 addr, new_addr, 1); 287 addr, new_addr, 1);
288 } else if (l4_proto == IPPROTO_UDP) { 288 } else if (l4_proto == NEXTHDR_UDP) {
289 if (likely(transport_len >= sizeof(struct udphdr))) { 289 if (likely(transport_len >= sizeof(struct udphdr))) {
290 struct udphdr *uh = udp_hdr(skb); 290 struct udphdr *uh = udp_hdr(skb);
291 291
@@ -296,6 +296,10 @@ static void update_ipv6_checksum(struct sk_buff *skb, u8 l4_proto,
296 uh->check = CSUM_MANGLED_0; 296 uh->check = CSUM_MANGLED_0;
297 } 297 }
298 } 298 }
299 } else if (l4_proto == NEXTHDR_ICMP) {
300 if (likely(transport_len >= sizeof(struct icmp6hdr)))
301 inet_proto_csum_replace16(&icmp6_hdr(skb)->icmp6_cksum,
302 skb, addr, new_addr, 1);
299 } 303 }
300} 304}
301 305
@@ -815,8 +819,6 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
815 819
816 case OVS_ACTION_ATTR_SAMPLE: 820 case OVS_ACTION_ATTR_SAMPLE:
817 err = sample(dp, skb, key, a); 821 err = sample(dp, skb, key, a);
818 if (unlikely(err)) /* skb already freed. */
819 return err;
820 break; 822 break;
821 } 823 }
822 824