diff options
author | Stefan Metzmacher <metze@sernet.de> | 2008-03-25 17:30:52 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-01-19 07:05:52 +0100 |
commit | fb64b12be5c347645976f8000a79f2d31c9a5c79 (patch) | |
tree | 6026a38f73bfff4baecb5b444ac2450ca16d0e01 /source4/nbt_server | |
parent | 81a2a43a5a3c13d08ed458d861d47f63a15ceac9 (diff) | |
download | samba-fb64b12be5c347645976f8000a79f2d31c9a5c79.tar.gz samba-fb64b12be5c347645976f8000a79f2d31c9a5c79.tar.bz2 samba-fb64b12be5c347645976f8000a79f2d31c9a5c79.zip |
winsserver_release: update the expire time if only one address is released
We also take the ownership if the record isn't owned.
This matches windows...
metze
(from samba4wins tree d7b19339c0444cbe0989fcfa91a22323215d2f6b)
Diffstat (limited to 'source4/nbt_server')
-rw-r--r-- | source4/nbt_server/wins/winsserver.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index c9d19936ed..464bf804a7 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -939,7 +939,18 @@ static void nbtd_winsserver_release(struct nbt_name_socket *nbtsock, break; } - if (rec->state == WREPL_STATE_RELEASED) { + if (rec->state == WREPL_STATE_ACTIVE) { + /* + * If the record is still active, we need to update the + * expire_time. + * + * if we're not the owner, we need to take the ownership. + */ + rec->expire_time= time(NULL) + winssrv->config.max_renew_interval; + if (strcmp(rec->wins_owner, winssrv->wins_db->local_owner) != 0) { + modify_flags = WINSDB_FLAG_ALLOC_VERSION | WINSDB_FLAG_TAKE_OWNERSHIP; + } + } else if (rec->state == WREPL_STATE_RELEASED) { /* * if we're not the owner, we need to take the owner ship * and make the record tombstone, but expire after |