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)
committerStefan Metzmacher <metze@samba.org>
Thu, 30 Jun 2011 11:20:05 +0000 (13:20 +0200)
metze

source3/nmbd/nmbd_subnetdb.c

index 666679a90b4a80c2a61cc77c2f50df930891b263..311a240923e658d69107eaa2e6454a58244e9bcd 100644 (file)
@@ -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);