mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
a6e2fe17eb
commit
4b261c75a9
10 changed files with 68 additions and 24 deletions
|
@ -33,8 +33,12 @@
|
|||
struct pingv6_ops {
|
||||
int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len,
|
||||
int *addr_len);
|
||||
int (*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 (*icmpv6_err_convert)(u8 type, u8 code, int *err);
|
||||
void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
|
||||
__be16 port, u32 info, u8 *payload);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue