• Nicholas Bellinger's avatar
    iscsi-target: Fix early login failure statistics misses · 17c61ad6
    Nicholas Bellinger authored
    Due to the long standing checks in iscsit_snmp_get_tiqn()
    that assume conn->sess->tpg dereference of tpg->tpg_tiqn
    for iscsit_collect_login_stats() usage, some of the early
    login failure cases like ISCSI_LOGIN_STATUS_TGT_FORBIDDEN
    where not getting incremented, due to sess->tpg assignment
    happening later in iscsi_login_zero_tsih_s2().
    
    Instead, use the earlier conn->tpg assignment done by
    iscsi_target_locate_portal() -> iscsit_get_tpg_from_np()
    so the existing counters are incremented correctly for
    the various early login failure cases.
    
    Also, go ahead and drop the old rate limiting check in
    iscsit_collect_login_stats(), so we get the true number
    of failed login attempts in the existing statistics.
    Reported-by: default avatarRyan Stiles <ras@datera.io>
    Cc: Ryan Stiles <ras@datera.io>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    17c61ad6
iscsi_target_util.c 36.4 KB