Merge "netsock2: backport ast_sockaddr_copy_sockaddr to asterisk 13." into 13

This commit is contained in:
Friendly Automation
2020-01-10 08:45:48 -06:00
committed by Gerrit Code Review

View File

@@ -140,6 +140,22 @@ static inline void ast_sockaddr_setnull(struct ast_sockaddr *addr)
addr->len = 0;
}
/*!
* \brief
* Copies the data from a sockaddr to an ast_sockaddr
*
* \param dst The destination ast_sockaddr
* \param src The source sockaddr
* \param len Length of the value stored in sockaddr
* \retval void
*/
static inline void ast_sockaddr_copy_sockaddr(struct ast_sockaddr *dst,
struct sockaddr *src, socklen_t len)
{
memcpy(dst, src, len);
dst->len = len;
}
/*!
* \since 1.8
*