@@ -211,18 +211,19 @@ public synchronized void stopRunning() {
211
211
_manager .unregisterEncryptedDestination (this , _encryptedLSHash );
212
212
_manager .unregisterConnection (this );
213
213
// netdb may be null in unit tests
214
- if (_context .netDb () != null ) {
214
+ String dbid = this .getDestHash ().toBase32 ();
215
+ if (_context .netDb ().getSubNetDB (dbid ) != null ) {
215
216
// Note that if the client sent us a destroy message,
216
217
// removeSession() was called just before this, and
217
218
// _sessions will be empty.
218
219
for (SessionParams sp : _sessions .values ()) {
219
220
LeaseSet ls = sp .currentLeaseSet ;
220
221
if (ls != null )
221
- _context .netDb ().unpublish (ls );
222
+ _context .netDb ().getSubNetDB ( dbid ). unpublish (ls );
222
223
// unpublish encrypted LS also
223
224
ls = sp .currentEncryptedLeaseSet ;
224
225
if (ls != null )
225
- _context .netDb ().unpublish (ls );
226
+ _context .netDb ().getSubNetDB ( dbid ). unpublish (ls );
226
227
if (!sp .isPrimary )
227
228
_context .tunnelManager ().removeAlias (sp .dest );
228
229
}
@@ -448,6 +449,7 @@ void removeSession(SessionId id) {
448
449
if (id == null )
449
450
return ;
450
451
boolean isPrimary = false ;
452
+ String dbid = this .getDestHash ().toBase32 ();
451
453
for (Iterator <SessionParams > iter = _sessions .values ().iterator (); iter .hasNext (); ) {
452
454
SessionParams sp = iter .next ();
453
455
if (id .equals (sp .sessionId )) {
@@ -458,11 +460,11 @@ void removeSession(SessionId id) {
458
460
_manager .unregisterSession (id , sp .dest );
459
461
LeaseSet ls = sp .currentLeaseSet ;
460
462
if (ls != null )
461
- _context .netDb ().unpublish (ls );
463
+ _context .netDb ().getSubNetDB ( dbid ). unpublish (ls );
462
464
// unpublish encrypted LS also
463
465
ls = sp .currentEncryptedLeaseSet ;
464
466
if (ls != null )
465
- _context .netDb ().unpublish (ls );
467
+ _context .netDb ().getSubNetDB ( dbid ). unpublish (ls );
466
468
isPrimary = sp .isPrimary ;
467
469
if (isPrimary )
468
470
_context .tunnelManager ().removeTunnels (sp .dest );
@@ -483,11 +485,11 @@ void removeSession(SessionId id) {
483
485
_manager .unregisterSession (sp .sessionId , sp .dest );
484
486
LeaseSet ls = sp .currentLeaseSet ;
485
487
if (ls != null )
486
- _context .netDb ().unpublish (ls );
488
+ _context .netDb ().getSubNetDB ( dbid ). unpublish (ls );
487
489
// unpublish encrypted LS also
488
490
ls = sp .currentEncryptedLeaseSet ;
489
491
if (ls != null )
490
- _context .netDb ().unpublish (ls );
492
+ _context .netDb ().getSubNetDB ( dbid ). unpublish (ls );
491
493
_context .tunnelManager ().removeAlias (sp .dest );
492
494
synchronized (this ) {
493
495
if (sp .rerequestTimer != null )
0 commit comments