diff options
author | Volker Lendecke <vl@samba.org> | 2010-08-28 17:25:22 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-08-29 21:55:25 +0200 |
commit | e466bb4af45175a3fe1d6dff54c10d81c4e68257 (patch) | |
tree | 321bf40efe545ddc5215f4e147b754d5e6d63bd6 /source3/modules | |
parent | e784e160ec899a32b673dfaa77fa12c8f27d296c (diff) | |
download | samba-e466bb4af45175a3fe1d6dff54c10d81c4e68257.tar.gz samba-e466bb4af45175a3fe1d6dff54c10d81c4e68257.tar.bz2 samba-e466bb4af45175a3fe1d6dff54c10d81c4e68257.zip |
s3: Remove smbd_server_fd()
This breaks the perfcol_onefs() build.
Tim, Steve, this use of smbd_server_fd is replacable by calls into
substitute.c. I don't have a onefs environment around to build a fix, so I've
decided to insert an #error, making it not compile. The fix should be pretty
obvious, you can get the socket data via "%I" and "%i" substitutions.
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/perfcount_onefs.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source3/modules/perfcount_onefs.c b/source3/modules/perfcount_onefs.c index 75dc14555c..d693376bfe 100644 --- a/source3/modules/perfcount_onefs.c +++ b/source3/modules/perfcount_onefs.c @@ -302,23 +302,26 @@ static void onefs_smb_statistics_end(struct smb_perfcount_data *pcd) /* get address info once, doesn't change for process */ if (rem_addr == 0) { - struct sockaddr_storage sa; - socklen_t sa_len; - int fd = smbd_server_fd(); - - sa_len = sizeof sa; - if (getpeername(fd, (struct sockaddr *)&sa, &sa_len) == 0 && - sa.ss_family == AF_INET) - rem_addr = ((struct sockaddr_in *)&sa)->sin_addr.s_addr; - else + +#error Isilon, please remove this after testing the code below + + char *addr; + + addr = talloc_sub_basic(talloc_tos(), "", "", "%I"); + if (addr != NULL) { + rem_addr = interpret_addr(addr); + TALLOC_FREE(addr); + } else { rem_addr = ISC_MASKED_ADDR; + } - sa_len = sizeof sa; - if (getsockname(fd, (struct sockaddr *)&sa, &sa_len) == 0 && - sa.ss_family == AF_INET) - loc_addr = ((struct sockaddr_in *)&sa)->sin_addr.s_addr; - else + addr = talloc_sub_basic(talloc_tos(), "", "", "%i"); + if (addr != NULL) { + loc_addr = interpret_addr(addr); + TALLOC_FREE(addr); + } else { loc_addr = ISC_MASKED_ADDR; + } } /* |