ssa_path_record[_data].c: Use 0 as invalid epoch value

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Improved error log message in ssa_check_listen_events

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
core.c: Fix DList corruption in core_orphan_adoption

If ssa_member is moved from orphan list to other DList,
pNext and pPrev fields in entry structure point to
nodes in new list. Subsequent removing  damages DLists.

Solution: Copy DList node to temporary object before
and using copy instead of pointer to origin entry.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
core.c: In core_orphan_adoption, change local variable name from head to entry

for better code clarity

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa_db.c: In ssa_db_increment_epoch, handle wraparound case

Epoch 0 is used as invalid epoch so when incrementing epoch
to 0 need to increment it an additional time.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: In ssa_upstream_handler, on SSA_CONN_REQ, log message if state is not as expected

Upstream connection state should be idle.

Will ultimately want more than just log message here if this occurs
and maybe different code flow than what happens now.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Add thread termination and cleanup mechanism for prdb_handler

When access service is stopped, cancel signal is sent
to prdb update queue handler. As a consequence of that
cleanup handler, that is cleaning the update queue,
prdb_handler_cleanup is called and after that the thread
halts its execution.

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>