aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2014-01-19 21:43:08 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-19 22:53:18 -0500
commit4b261c75a99f29c93a0b6babfc180cdf566bd654 (patch)
tree2c1fcebd79d2fcb1625f89ef5067605151953010 /net/ipv6/udp.c
parenta6e2fe17eba47681e82cdb9cfed5a67b57802a78 (diff)
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 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 233c3ab6aee4..1e586d92260e 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -477,12 +477,16 @@ try_again:
477 } 477 }
478 *addr_len = sizeof(*sin6); 478 *addr_len = sizeof(*sin6);
479 } 479 }
480
481 if (np->rxopt.all)
482 ip6_datagram_recv_common_ctl(sk, msg, skb);
483
480 if (is_udp4) { 484 if (is_udp4) {
481 if (inet->cmsg_flags) 485 if (inet->cmsg_flags)
482 ip_cmsg_recv(msg, skb); 486 ip_cmsg_recv(msg, skb);
483 } else { 487 } else {
484 if (np->rxopt.all) 488 if (np->rxopt.all)
485 ip6_datagram_recv_ctl(sk, msg, skb); 489 ip6_datagram_recv_specific_ctl(sk, msg, skb);
486 } 490 }
487 491
488 err = copied; 492 err = copied;