Hi,

Due to performance reasons, we've an application which we cannot change which opens up a few TCP sockets. We would like therefore to make communications from a specific TCP IP/port to instead use a unix domain socket.

So far in LD_PRELOAD, I have overriden bind() to look at the IP/port of the sockfd and if it matches one which should instead be a unix domain socket, to create this unix domain socket, and then bind to it. (All other calls to bind() from this application which doesn't match the IP/port of the socket we wish to change is just left to call bind() normally).

Then in accept(), I am at a loss as to what do because I do not know how to turn the sockfd for the socket which we want to be the AF_UNIX one---or if I would need to call the real accept() first and then change the struct sockaddr *addr pointer to be something else, etc.

So I am asking if anyone has any ideas.

TIA,

Jason