diff options
author | Tom Herbert <therbert@google.com> | 2015-01-05 16:56:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-05 22:44:46 -0500 |
commit | 5961de9f199bef6ff437d7d85fe69b6a1964739b (patch) | |
tree | 153942fe128647a10b312beaf546ea791a0558b3 /net/ipv4/ip_sockglue.c | |
parent | c44d13d6f341ca59f3d6646f2337d4d3c8a814a6 (diff) |
ip: Add offset parameter to ip_cmsg_recv
Add ip_cmsg_recv_offset function which takes an offset argument
that indicates the starting offset in skb where data is being received
from. This will be useful in the case of UDP and provided checksum
to user space.
ip_cmsg_recv is an inline call to ip_cmsg_recv_offset with offset of
zero.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 80f78565b41b..513d506ffebb 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -136,7 +136,8 @@ static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb) | |||
136 | put_cmsg(msg, SOL_IP, IP_ORIGDSTADDR, sizeof(sin), &sin); | 136 | put_cmsg(msg, SOL_IP, IP_ORIGDSTADDR, sizeof(sin), &sin); |
137 | } | 137 | } |
138 | 138 | ||
139 | void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) | 139 | void ip_cmsg_recv_offset(struct msghdr *msg, struct sk_buff *skb, |
140 | int offset) | ||
140 | { | 141 | { |
141 | struct inet_sock *inet = inet_sk(skb->sk); | 142 | struct inet_sock *inet = inet_sk(skb->sk); |
142 | unsigned int flags = inet->cmsg_flags; | 143 | unsigned int flags = inet->cmsg_flags; |
@@ -194,7 +195,7 @@ void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) | |||
194 | ip_cmsg_recv_dstaddr(msg, skb); | 195 | ip_cmsg_recv_dstaddr(msg, skb); |
195 | 196 | ||
196 | } | 197 | } |
197 | EXPORT_SYMBOL(ip_cmsg_recv); | 198 | EXPORT_SYMBOL(ip_cmsg_recv_offset); |
198 | 199 | ||
199 | int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc, | 200 | int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc, |
200 | bool allow_ipv6) | 201 | bool allow_ipv6) |