s3:nmbd_subnetdb: close all sockets attached to a subnet in close_subnet() (bug ...
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jun 2011 08:09:56 +0000 (10:09 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Aug 2011 19:09:54 +0000 (21:09 +0200)
metze
(cherry picked from commit 75e9f2110876137a57632d223248ac51dbfc4569)
(cherry picked from commit 48355dae98885ca0d44dbf4206a0bdf16c64fced)

source3/nmbd/nmbd_subnetdb.c

index 703e229052c3d3e986cd2df20a92772584cd4326..48dbe66e309c836b25db26abc8bf01b19f6c120f 100644 (file)
@@ -55,13 +55,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);