From: Mark Brown Date: Fri, 4 Apr 2014 12:27:31 +0000 (+0100) Subject: net: ipv6: Fix ipv6_recv_error signature X-Git-Tag: firefly_0821_release~3680^2~149 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=14a31bfd6672fe6b6c9b152cdafa71863f937504;p=firefly-linux-kernel-4.4.55.git net: ipv6: Fix ipv6_recv_error signature When the ipv6 ping code was backported the code appears to have been cherry picked from upstream without adjusting the signature of ipv6_recv_error(). In upstream and in the cherry pick the final addr_len parameter has been dropped but the v3.10 definition had this argument. Adjust the definition and all callers to follow the upstream pattern. Signed-off-by: Mark Brown --- diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 08a85885dbb9..687d92a3a3c7 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -799,8 +799,7 @@ extern int compat_ipv6_getsockopt(struct sock *sk, extern int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); -extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, - int *addr_len); +extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); extern int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, int *addr_len); extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 8997340e3742..1aef8b22ba73 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -318,7 +318,7 @@ void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu) /* * Handle MSG_ERRQUEUE */ -int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) +int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) { struct ipv6_pinfo *np = inet6_sk(sk); struct sock_exterr_skb *serr; @@ -369,7 +369,6 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) &sin->sin6_addr); sin->sin6_scope_id = 0; } - *addr_len = sizeof(*sin); } memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 464b1c9c08e4..dff1f4b2c668 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -459,8 +459,10 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, if (flags & MSG_OOB) return -EOPNOTSUPP; - if (flags & MSG_ERRQUEUE) - return ipv6_recv_error(sk, msg, len, addr_len); + if (flags & MSG_ERRQUEUE) { + *addr_len = sizeof(struct sockaddr_in6); + return ipv6_recv_error(sk, msg, len); + } if (np->rxpmtu && np->rxopt.bits.rxpmtu) return ipv6_recv_rxpmtu(sk, msg, len, addr_len); diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 6b298dc614e3..c46539a1df56 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -373,8 +373,10 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, int is_udp4; bool slow; - if (flags & MSG_ERRQUEUE) - return ipv6_recv_error(sk, msg, len, addr_len); + if (flags & MSG_ERRQUEUE) { + *addr_len = sizeof(struct sockaddr_in6); + return ipv6_recv_error(sk, msg, len); + } if (np->rxpmtu && np->rxopt.bits.rxpmtu) return ipv6_recv_rxpmtu(sk, msg, len, addr_len);