In addition to closing the fds and deleting the tgt events also cleaning the portals list. Signed-off-by: Roi Dayan <roid@xxxxxxxxxxxx> --- usr/iscsi/iscsi_tcp.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/usr/iscsi/iscsi_tcp.c b/usr/iscsi/iscsi_tcp.c index 1988b2f..0c43039 100644 --- a/usr/iscsi/iscsi_tcp.c +++ b/usr/iscsi/iscsi_tcp.c @@ -318,14 +318,11 @@ static int iscsi_tcp_init(void) static void iscsi_tcp_exit(void) { - int i; + struct iscsi_portal *portal, *ptmp; - for (i = 0; i < ARRAY_SIZE(listen_fds); i++) { - if (!listen_fds[i]) - break; - - tgt_event_del(listen_fds[i]); - close(listen_fds[i]); + list_for_each_entry_safe(portal, ptmp, &iscsi_portals_list, + iscsi_portal_siblings) { + iscsi_delete_portal(portal->addr, portal->port); } } -- 1.7.8.2 -- To unsubscribe from this list: send the line "unsubscribe stgt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html