atomic_inc (&conn->ibc_refcount);
}
- if (list_empty (&peer->ibp_conns) &&
- peer->ibp_persistence == 0) {
- /* Non-persistent peer with no more conns... */
+ if (list_empty (&peer->ibp_conns) && /* no more conns */
+ peer->ibp_persistence == 0 && /* non-persistent peer */
+ kibnal_peer_active(peer)) { /* still in peer table */
kibnal_unlink_peer_locked (peer);
}
atomic_inc (&conn->ibc_refcount);
}
- if (list_empty (&peer->ibp_conns) &&
- peer->ibp_persistence == 0) {
- /* Non-persistent peer with no more conns... */
+ if (list_empty (&peer->ibp_conns) && /* no more conns */
+ peer->ibp_persistence == 0 && /* non-persistent peer */
+ kibnal_peer_active(peer)) { /* still in peer table */
kibnal_unlink_peer_locked (peer);
}
/* connd takes ibc_list's ref */
list_del (&conn->ibc_list);
- if (list_empty (&peer->ibp_conns) &&
- peer->ibp_persistence == 0) {
- /* Non-persistent peer with no more conns... */
+ if (list_empty (&peer->ibp_conns) && /* no more conns */
+ peer->ibp_persistence == 0 && /* non-persistent peer */
+ kibnal_peer_active(peer)) { /* still in peer table */
kibnal_unlink_peer_locked (peer);
}