summaryrefslogtreecommitdiff
path: root/vxi11_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'vxi11_server.c')
-rw-r--r--vxi11_server.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vxi11_server.c b/vxi11_server.c
index d5b973d..d6007c1 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -8,6 +8,8 @@
#include "stdio.h"
#include "globals.h"
#include <stdbool.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#define ERR_SYNTAXERROR 1
#define ERR_DEVICENOTACCESSIBLE 3
@@ -62,7 +64,11 @@ create_link_1_svc(Create_LinkParms *argp, struct svc_req *rqstp) {
static Create_LinkResp result;
globals.Remote.vxi_connections++;
result.error = 0;
- result.abortPort = 1234;
+
+ struct sockaddr_in sin;
+ socklen_t len = sizeof(sin);
+ getsockname(rqstp->rq_xprt->xp_sock, (struct sockaddr *) &sin, &len);
+ result.abortPort = sin.sin_port;
return &result;
}