[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Thu Jun 30 06:30:01 MDT 2011


The branch, master has been updated
       via  c234b4b lib/util/string_wrappers: move everything into one HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS block
       via  75e9f21 s3:nmbd_subnetdb: close all sockets attached to a subnet in close_subnet() (bug #8276)
      from  847ca0a s3:smbd do not panic when CTDB is unhealthy (Bug #8278)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c234b4b0c0c59c4e972d0832aefc6a94f41f4e1f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jun 24 21:49:16 2011 +0200

    lib/util/string_wrappers: move everything into one HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS block
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Thu Jun 30 14:29:41 CEST 2011 on sn-devel-104

commit 75e9f2110876137a57632d223248ac51dbfc4569
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jun 30 10:09:56 2011 +0200

    s3:nmbd_subnetdb: close all sockets attached to a subnet in close_subnet() (bug #8276)
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 lib/util/string_wrappers.h   |   26 ++++++++------------------
 source3/nmbd/nmbd_subnetdb.c |   14 +++++++++++---
 2 files changed, 19 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/string_wrappers.h b/lib/util/string_wrappers.h
index 37384fc..6f2d6e9 100644
--- a/lib/util/string_wrappers.h
+++ b/lib/util/string_wrappers.h
@@ -23,24 +23,6 @@
 #ifndef _STRING_WRAPPERS_H
 #define _STRING_WRAPPERS_H
 
-/* We need a number of different prototypes for our
-   non-existant fuctions */
-char * __unsafe_string_function_usage_here__(void);
-
-size_t __unsafe_string_function_usage_here_size_t__(void);
-
-#ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS
-
-/* if the compiler will optimize out function calls, then use this to tell if we are
-   have the correct types (this works only where sizeof() returns the size of the buffer, not
-   the size of the pointer). */
-
-#define CHECK_STRING_SIZE(d, len) (sizeof(d) != (len) && sizeof(d) != sizeof(char *))
-
-#else /* HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS */
-
-#endif /* HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS */
-
 #define strlcpy_base(dest, src, base, size) \
 do { \
 	const char *_strlcpy_base_src = (const char *)src; \
@@ -74,6 +56,14 @@ do { \
 
 #ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS
 
+/* We need a number of different prototypes for our
+   non-existant fuctions */
+char * __unsafe_string_function_usage_here__(void);
+
+size_t __unsafe_string_function_usage_here_size_t__(void);
+
+#define CHECK_STRING_SIZE(d, len) (sizeof(d) != (len) && sizeof(d) != sizeof(char *))
+
 /* if the compiler will optimize out function calls, then use this to tell if we are
    have the correct types (this works only where sizeof() returns the size of the buffer, not
    the size of the pointer). */
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
index 666679a..311a240 100644
--- a/source3/nmbd/nmbd_subnetdb.c
+++ b/source3/nmbd/nmbd_subnetdb.c
@@ -56,13 +56,21 @@ yet and it may be in use by a response record
 
 void close_subnet(struct subnet_record *subrec)
 {
+	if (subrec->nmb_sock != -1) {
+		close(subrec->nmb_sock);
+		subrec->nmb_sock = -1;
+	}
+	if (subrec->nmb_bcast != -1) {
+		close(subrec->nmb_bcast);
+		subrec->nmb_bcast = -1;
+	}
 	if (subrec->dgram_sock != -1) {
 		close(subrec->dgram_sock);
 		subrec->dgram_sock = -1;
 	}
-	if (subrec->nmb_sock != -1) {
-		close(subrec->nmb_sock);
-		subrec->nmb_sock = -1;
+	if (subrec->dgram_bcast != -1) {
+		close(subrec->dgram_bcast);
+		subrec->dgram_bcast = -1;
 	}
 
 	DLIST_REMOVE(subnetlist, subrec);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list