From c16d4aec00230983973be3b827d1209f5db65d9c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 20 Feb 1998 19:48:01 +0000 Subject: nmbd_packets.c: nmbd_subnetdb.c: Patch from Andrey Alekseyev to fix the fact that retransmit_or_expire_response_records() wasn't looking at the WINS subnet. server.c: Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution. smbpass.c: Fix to stop parsing failing on non-valid lines. trans2.c: Fix for volume serial number code. util.c: Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution. Fix for warnings under RH5. gcc 2.8. Jeremy. (This used to be commit e58ab3bbe6e939ba678ad5482e58e0191c8dcbcb) --- source3/nmbd/nmbd_packets.c | 8 ++++++-- source3/nmbd/nmbd_subnetdb.c | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 9dad5ddaa9..cd99343e70 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/nmbd/nmbd_packets.c @@ -1486,14 +1486,18 @@ void run_packet_queue() /******************************************************************* Retransmit or timeout elements from all the outgoing subnet response - record queues. + record queues. NOTE that this code must also check the WINS server + subnet for response records to timeout as the WINS server code + can send requests to check if a client still owns a name. + (Patch from Andrey Alekseyev ). ******************************************************************/ void retransmit_or_expire_response_records(time_t t) { struct subnet_record *subrec; - for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) + for (subrec = FIRST_SUBNET; subrec; + subrec = get_next_subnet_maybe_unicast_or_wins_server(subrec)) { struct response_record *rrec, *nextrrec; diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c index 5e18fe9cc0..07692cc82c 100644 --- a/source3/nmbd/nmbd_subnetdb.c +++ b/source3/nmbd/nmbd_subnetdb.c @@ -289,3 +289,27 @@ struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec else return subrec->next; } + +/******************************************************************* + Access function used by retransmit_or_expire_response_records() in + nmbd_packets.c. Patch from Andrey Alekseyev + Needed when we need to enumerate all the broadcast, unicast and + WINS subnets. +******************************************************************/ + +struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec) +{ + if(subrec == unicast_subnet) + if(wins_server_subnet) + return wins_server_subnet; + else + return NULL; + + if(wins_server_subnet && subrec == wins_server_subnet) + return NULL; + + if((subrec->next == NULL) && we_are_a_wins_client()) + return unicast_subnet; + else + return subrec->next; +} -- cgit