From 48355dae98885ca0d44dbf4206a0bdf16c64fced Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 30 Jun 2011 10:09:56 +0200 Subject: [PATCH] s3:nmbd_subnetdb: close all sockets attached to a subnet in close_subnet() (bug #8276) metze (cherry picked from commit 75e9f2110876137a57632d223248ac51dbfc4569) --- source3/nmbd/nmbd_subnetdb.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c index 703e229052c..48dbe66e309 100644 --- a/source3/nmbd/nmbd_subnetdb.c +++ b/source3/nmbd/nmbd_subnetdb.c @@ -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); -- 2.11.4.GIT