diff --git a/src/pmcd/src/client.c b/src/pmcd/src/client.c index b4f57ef..1df4dde 100644 --- a/src/pmcd/src/client.c +++ b/src/pmcd/src/client.c @@ -76,7 +76,7 @@ NotifyEndContext(int ctx) /* Establish a new socket connection to a client */ ClientInfo * -AcceptNewClient(int reqfd) +AcceptNewClient(int reqfd, int family) { static unsigned int seq = 0; int i, fd; @@ -85,6 +85,7 @@ AcceptNewClient(int reqfd) i = NewClient(); addrlen = __pmSockAddrSize(); + __pmSockAddrSetFamily(client[i].addr, family); fd = __pmAccept(reqfd, client[i].addr, &addrlen); if (fd == -1) { if (neterror() == EPERM) { diff --git a/src/pmcd/src/client.h b/src/pmcd/src/client.h index a78d20a..6134077 100644 --- a/src/pmcd/src/client.h +++ b/src/pmcd/src/client.h @@ -44,7 +44,7 @@ extern __pmFdSet clientFds; /* for client select() */ PMCD_DATA extern int this_client_id; /* client for current request */ /* prototypes */ -extern ClientInfo *AcceptNewClient(int); +extern ClientInfo *AcceptNewClient(int, int); extern int NewClient(void); extern void DeleteClient(ClientInfo *); PMCD_CALL extern ClientInfo *GetClient(int); diff --git a/src/pmcd/src/pmcd.c b/src/pmcd/src/pmcd.c index dd32f56..18413eb 100644 --- a/src/pmcd/src/pmcd.c +++ b/src/pmcd/src/pmcd.c @@ -657,7 +657,7 @@ CheckNewClient(__pmFdSet * fdset, int rfd, int family) ClientInfo *cp; if (__pmFD_ISSET(rfd, fdset)) { - if ((cp = AcceptNewClient(rfd)) == NULL) + if ((cp = AcceptNewClient(rfd, family)) == NULL) return; /* Accept failed and no client added */ sts = __pmAccAddClient(cp->addr, &cp->denyOps);