FreeBSD Bugzilla – Attachment 163319 Details for
Bug 204650
[libc][rpc-svc][patch] rendezvous_request() does not populate local address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Populate local address when creating new transporter for connection oritented transporters
svc_vc.c.patch (text/plain), 1.19 KB, created by
alex.burlyga.ietf
on 2015-11-19 03:48:56 UTC
(
hide
)
Description:
Populate local address when creating new transporter for connection oritented transporters
Filename:
MIME Type:
Creator:
alex.burlyga.ietf
Created:
2015-11-19 03:48:56 UTC
Size:
1.19 KB
patch
obsolete
>Index: lib/libc/rpc/svc_vc.c >=================================================================== >--- lib/libc/rpc/svc_vc.c (revision 290964) >+++ lib/libc/rpc/svc_vc.c (working copy) >@@ -281,8 +281,8 @@ > int sock, flags; > struct cf_rendezvous *r; > struct cf_conn *cd; >- struct sockaddr_storage addr; >- socklen_t len; >+ struct sockaddr_storage addr, sslocal; >+ socklen_t len, slen; > struct __rpc_sockinfo si; > SVCXPRT *newxprt; > fd_set cleanfds; >@@ -347,6 +347,20 @@ > __xdrrec_setnonblock(&cd->xdrs, cd->maxrec); > } else > cd->nonblock = FALSE; >+ slen = sizeof(struct sockaddr_storage); >+ if(_getsockname(sock, (struct sockaddr *)(void *)&sslocal, &slen) < 0) { >+ warnx("svc_vc_create: could not retrieve local addr"); >+ newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; >+ } else { >+ newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = sslocal.ss_len; >+ newxprt->xp_ltaddr.buf = mem_alloc((size_t)sslocal.ss_len); >+ if (newxprt->xp_ltaddr.buf == NULL) { >+ warnx("svc_vc_create: no mem for local addr"); >+ newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; >+ } else { >+ memcpy(newxprt->xp_ltaddr.buf, &sslocal, (size_t)sslocal.ss_len); >+ } >+ } > > gettimeofday(&cd->last_recv_time, NULL); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204650
:
163272
| 163319