diff options
Diffstat (limited to 'net/appletalk')
-rw-r--r-- | net/appletalk/ddp.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 7fee50d637f9..7d424ac6e760 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
@@ -1735,7 +1735,6 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr | |||
1735 | size_t size, int flags) | 1735 | size_t size, int flags) |
1736 | { | 1736 | { |
1737 | struct sock *sk = sock->sk; | 1737 | struct sock *sk = sock->sk; |
1738 | struct sockaddr_at *sat = (struct sockaddr_at *)msg->msg_name; | ||
1739 | struct ddpehdr *ddp; | 1738 | struct ddpehdr *ddp; |
1740 | int copied = 0; | 1739 | int copied = 0; |
1741 | int offset = 0; | 1740 | int offset = 0; |
@@ -1764,14 +1763,13 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr | |||
1764 | } | 1763 | } |
1765 | err = skb_copy_datagram_iovec(skb, offset, msg->msg_iov, copied); | 1764 | err = skb_copy_datagram_iovec(skb, offset, msg->msg_iov, copied); |
1766 | 1765 | ||
1767 | if (!err) { | 1766 | if (!err && msg->msg_name) { |
1768 | if (sat) { | 1767 | struct sockaddr_at *sat = msg->msg_name; |
1769 | sat->sat_family = AF_APPLETALK; | 1768 | sat->sat_family = AF_APPLETALK; |
1770 | sat->sat_port = ddp->deh_sport; | 1769 | sat->sat_port = ddp->deh_sport; |
1771 | sat->sat_addr.s_node = ddp->deh_snode; | 1770 | sat->sat_addr.s_node = ddp->deh_snode; |
1772 | sat->sat_addr.s_net = ddp->deh_snet; | 1771 | sat->sat_addr.s_net = ddp->deh_snet; |
1773 | } | 1772 | msg->msg_namelen = sizeof(*sat); |
1774 | msg->msg_namelen = sizeof(*sat); | ||
1775 | } | 1773 | } |
1776 | 1774 | ||
1777 | skb_free_datagram(sk, skb); /* Free the datagram. */ | 1775 | skb_free_datagram(sk, skb); /* Free the datagram. */ |