summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-06-30 10:09:56 +0200
committerKarolin Seeger <kseeger@samba.org>2011-07-26 21:52:05 +0200
commit807cc2ced529ced8a40ff65f11b8748c9abb3761 (patch)
treebd82e19c7ebe21e419c980122feee71ab3eb024f
parent00836e62ae58ca687b2ad6ed509b9ca4bf1009c4 (diff)
downloadsamba-807cc2ced529ced8a40ff65f11b8748c9abb3761.tar.gz
samba-807cc2ced529ced8a40ff65f11b8748c9abb3761.tar.xz
samba-807cc2ced529ced8a40ff65f11b8748c9abb3761.zip
s3:nmbd_subnetdb: close all sockets attached to a subnet in close_subnet() (bug #8276)
metze (cherry picked from commit 75e9f2110876137a57632d223248ac51dbfc4569) (cherry picked from commit 1c8690c82905ff55ed9eafd02df295edf79e7943)
-rw-r--r--source3/nmbd/nmbd_subnetdb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
index 3a60038dcdc..40c985dcdda 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);