Diff between 4e309bd193ac1babb2c3e0db2f34ab18d208489b and a8a9649850f8f939ec5df9a53e9eddbbf40afd24

Changed Files

File Additions Deletions Status
obexd/src/obex.c +10 -0 modified
obexd/src/obex.h +1 -0 modified

Full Patch

diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index a3e7b0e..7a1d612 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -1226,6 +1226,16 @@ int obex_getpeername(struct obex_session *os, char **name)
 	return transport->getpeername(os->io, name);
 }
 
+int obex_getsockname(struct obex_session *os, char **name)
+{
+	struct obex_transport_driver *transport = os->server->transport;
+
+	if (transport == NULL || transport->getsockname == NULL)
+		return -ENOTSUP;
+
+	return transport->getsockname(os->io, name);
+}
+
 int memncmp0(const void *a, size_t na, const void *b, size_t nb)
 {
 	if (na != nb)
diff --git a/obexd/src/obex.h b/obexd/src/obex.h
index 443a748..fc16747 100644
--- a/obexd/src/obex.h
+++ b/obexd/src/obex.h
@@ -46,6 +46,7 @@ ssize_t obex_get_apparam(struct obex_session *os, const uint8_t **buffer);
 ssize_t obex_get_non_header_data(struct obex_session *os,
 							const uint8_t **data);
 int obex_getpeername(struct obex_session *os, char **name);
+int obex_getsockname(struct obex_session *os, char **name);
 
 /* Just a thin wrapper around memcmp to deal with NULL values */
 int memncmp0(const void *a, size_t na, const void *b, size_t nb);