diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2014-01-20 03:43:08 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-19 19:53:18 -0800 |
commit | 4b261c75a99f29c93a0b6babfc180cdf566bd654 (patch) | |
tree | 2c1fcebd79d2fcb1625f89ef5067605151953010 /include/net/transp_v6.h | |
parent | a6e2fe17eba47681e82cdb9cfed5a67b57802a78 (diff) | |
download | linux-4b261c75a99f29c93a0b6babfc180cdf566bd654.tar.gz linux-4b261c75a99f29c93a0b6babfc180cdf566bd654.tar.bz2 linux-4b261c75a99f29c93a0b6babfc180cdf566bd654.zip |
ipv6: make IPV6_RECVPKTINFO work for ipv4 datagrams
We currently don't report IPV6_RECVPKTINFO in cmsg access ancillary data
for IPv4 datagrams on IPv6 sockets.
This patch splits the ip6_datagram_recv_ctl into two functions, one
which handles both protocol families, AF_INET and AF_INET6, while the
ip6_datagram_recv_specific_ctl only handles IPv6 cmsg data.
ip6_datagram_recv_*_ctl never reported back any errors, so we can make
them return void. Also provide a helper for protocols which don't offer dual
personality to further use ip6_datagram_recv_ctl, which is exported to
modules.
I needed to shuffle the code for ping around a bit to make it easier to
implement dual personality for ping ipv6 sockets in future.
Reported-by: Gert Doering <gert@space.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/transp_v6.h')
-rw-r--r-- | include/net/transp_v6.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 48660e50ae90..b927413dde86 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h @@ -32,8 +32,13 @@ void tcpv6_exit(void); int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); -int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, - struct sk_buff *skb); +/* this does all the common and the specific ctl work */ +void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, + struct sk_buff *skb); +void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg, + struct sk_buff *skb); +void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg, + struct sk_buff *skb); int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg, struct flowi6 *fl6, struct ipv6_txoptions *opt, |