From e466bb4af45175a3fe1d6dff54c10d81c4e68257 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 28 Aug 2010 17:25:22 +0200 Subject: 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. --- source3/modules/perfcount_onefs.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'source3/modules') 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; + } } /* -- cgit