[Asterisk-code-review] netsock2: backport ast_sockaddr_copy_sockaddr to asterisk 13. (asterisk[13])

Jaco Kroon asteriskteam at digium.com
Sun Dec 22 10:08:04 CST 2019


Jaco Kroon has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13502 )


Change subject: netsock2: backport ast_sockaddr_copy_sockaddr to asterisk 13.
......................................................................

netsock2: backport ast_sockaddr_copy_sockaddr to asterisk 13.

This function is already present in 15, 16 and master.

Change-Id: I491ddecdccc87620c264567c549217e48f3d4ff1
Signed-off-by: Jaco Kroon <jaco at uls.co.za>
---
M include/asterisk/netsock2.h
1 file changed, 16 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/02/13502/1

diff --git a/include/asterisk/netsock2.h b/include/asterisk/netsock2.h
index b6f2858..b62ca4c 100644
--- a/include/asterisk/netsock2.h
+++ b/include/asterisk/netsock2.h
@@ -141,6 +141,22 @@
 }
 
 /*!
+ * \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
  *
  * \brief

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13502
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I491ddecdccc87620c264567c549217e48f3d4ff1
Gerrit-Change-Number: 13502
Gerrit-PatchSet: 1
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191222/1326e4e8/attachment.html>


More information about the asterisk-code-review mailing list