For an accepted connection (tcp), set xp_netid, as it might be examined
by some applications, most notably rpcbind.
This commit is contained in:
parent
a43773b43f
commit
3b9024546d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: svc_vc.c,v 1.6 2000/07/08 11:41:50 kleink Exp $ */
|
||||
/* $NetBSD: svc_vc.c,v 1.7 2000/08/03 00:01:53 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
@ -35,7 +35,7 @@
|
||||
static char *sccsid = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
|
||||
static char *sccsid = "@(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC";
|
||||
#else
|
||||
__RCSID("$NetBSD: svc_vc.c,v 1.6 2000/07/08 11:41:50 kleink Exp $");
|
||||
__RCSID("$NetBSD: svc_vc.c,v 1.7 2000/08/03 00:01:53 fvdl Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -252,12 +252,14 @@ makefd_xprt(fd, sendsize, recvsize)
|
||||
{
|
||||
SVCXPRT *xprt;
|
||||
struct cf_conn *cd;
|
||||
const char *netid;
|
||||
struct __rpc_sockinfo si;
|
||||
|
||||
_DIAGASSERT(fd != -1);
|
||||
|
||||
xprt = mem_alloc(sizeof(SVCXPRT));
|
||||
if (xprt == NULL) {
|
||||
warnx("svc_tcp: makefd_xprt: out of memory");
|
||||
warnx("svc_vc: makefd_xprt: out of memory");
|
||||
goto done;
|
||||
}
|
||||
memset(xprt, 0, sizeof *xprt);
|
||||
@ -276,6 +278,9 @@ makefd_xprt(fd, sendsize, recvsize)
|
||||
svc_vc_ops(xprt); /* truely deals with calls */
|
||||
xprt->xp_port = 0; /* this is a connection, not a rendezvouser */
|
||||
xprt->xp_fd = fd;
|
||||
if (__rpc_fd2sockinfo(fd, &si) && __rpc_sockinfo2netid(&si, &netid))
|
||||
xprt->xp_netid = strdup(netid);
|
||||
|
||||
xprt_register(xprt);
|
||||
done:
|
||||
return (xprt);
|
||||
|
Loading…
Reference in New Issue
Block a user