ipa_server_conn: Add remote (peer) address to struct

This is better than every implementation calling getpeername()
on its own.
diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h
index 6e9f9dd..6447ccd 100644
--- a/include/osmocom/abis/ipa.h
+++ b/include/osmocom/abis/ipa.h
@@ -38,6 +38,9 @@
 	int (*cb)(struct ipa_server_conn *peer, struct msgb *msg);
 	void				*data;
 	struct msgb			*pending_msg;
+	/* remote address information */
+	const char			*addr;
+	uint16_t			port;
 };
 
 struct ipa_server_conn *
diff --git a/src/input/ipa.c b/src/input/ipa.c
index a10a418..bd1671b 100644
--- a/src/input/ipa.c
+++ b/src/input/ipa.c
@@ -401,6 +401,8 @@
 		int (*closed_cb)(struct ipa_server_conn *conn), void *data)
 {
 	struct ipa_server_conn *conn;
+	struct sockaddr_in sa;
+	socklen_t sa_len = sizeof(sa);
 
 	conn = talloc_zero(ctx, struct ipa_server_conn);
 	if (conn == NULL) {
@@ -418,6 +420,12 @@
 	conn->data = data;
 	INIT_LLIST_HEAD(&conn->tx_queue);
 
+	if (!getpeername(fd, (struct sockaddr *)&sa, &sa_len)) {
+		char *str = inet_ntoa(sa.sin_addr);
+		conn->addr = talloc_strdup(conn, str);
+		conn->port = ntohs(sa.sin_port);
+	}
+
 	if (osmo_fd_register(&conn->ofd) < 0) {
 		LOGP(DLINP, LOGL_ERROR, "could not register FD\n");
 		talloc_free(conn);