]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/openvswitch/vport.h
openvswitch: make skb->csum consistent with rest of networking stack.
[mirror_ubuntu-bionic-kernel.git] / net / openvswitch / vport.h
index 1cef5cd3be47681f0a2cc2950d47bf75cd8ffaf2..293278c4c2df8b3774074af997fe0a1125bc74b7 100644 (file)
@@ -192,4 +192,11 @@ void ovs_vport_record_error(struct vport *, enum vport_err_type err_type);
 extern const struct vport_ops ovs_netdev_vport_ops;
 extern const struct vport_ops ovs_internal_vport_ops;
 
+static inline void ovs_skb_postpush_rcsum(struct sk_buff *skb,
+                                     const void *start, unsigned int len)
+{
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
+               skb->csum = csum_add(skb->csum, csum_partial(start, len, 0));
+}
+
 #endif /* vport.h */