On Wed, 2014-12-03 at 16:44 -0800, Tom Herbert wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 221b53f..bba2e06 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1315,8 +1315,16 @@ try_again:
memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
*addr_len = sizeof(*sin);
}
- if (inet->cmsg_flags)
+ if (inet->cmsg_flags) {
+ /* Pull checksum past UDP header in case we are providing
+ * checksum in cmsg.
+ */
+ if (inet->cmsg_flags & IP_CMSG_CHECKSUM)
+ skb_postpull_rcsum(skb, skb->data,
+ sizeof(struct udphdr));
+
ip_cmsg_recv(msg, skb);
+ }
Have you tried MSG_PEEK ?
You can not modify the skb, you need to do something else.