Use keys_add_int() where appropriate. No functional changes.
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
dce704a67a
commit
2e779f745b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271320
@ -785,8 +785,7 @@ login_negotiate(struct connection *conn, struct pdu *request)
|
||||
struct pdu *response;
|
||||
struct iscsi_bhs_login_response *bhslr2;
|
||||
struct keys *request_keys, *response_keys;
|
||||
char *portal_group_tag;
|
||||
int i, rv;
|
||||
int i;
|
||||
bool skipped_security;
|
||||
|
||||
if (request == NULL) {
|
||||
@ -813,13 +812,8 @@ login_negotiate(struct connection *conn, struct pdu *request)
|
||||
if (conn->conn_target->t_alias != NULL)
|
||||
keys_add(response_keys,
|
||||
"TargetAlias", conn->conn_target->t_alias);
|
||||
rv = asprintf(&portal_group_tag, "%d",
|
||||
keys_add_int(response_keys, "TargetPortalGroupTag",
|
||||
conn->conn_portal->p_portal_group->pg_tag);
|
||||
if (rv <= 0)
|
||||
log_err(1, "asprintf");
|
||||
keys_add(response_keys,
|
||||
"TargetPortalGroupTag", portal_group_tag);
|
||||
free(portal_group_tag);
|
||||
}
|
||||
|
||||
for (i = 0; i < KEYS_MAX; i++) {
|
||||
@ -852,8 +846,6 @@ login(struct connection *conn)
|
||||
struct auth_group *ag;
|
||||
const char *initiator_name, *initiator_alias, *session_type,
|
||||
*target_name, *auth_method;
|
||||
char *portal_group_tag;
|
||||
int rv;
|
||||
|
||||
/*
|
||||
* Handle the initial Login Request - figure out required authentication
|
||||
@ -1032,13 +1024,8 @@ login(struct connection *conn)
|
||||
if (conn->conn_target->t_alias != NULL)
|
||||
keys_add(response_keys,
|
||||
"TargetAlias", conn->conn_target->t_alias);
|
||||
rv = asprintf(&portal_group_tag, "%d",
|
||||
keys_add_int(response_keys, "TargetPortalGroupTag",
|
||||
conn->conn_portal->p_portal_group->pg_tag);
|
||||
if (rv <= 0)
|
||||
log_err(1, "asprintf");
|
||||
keys_add(response_keys,
|
||||
"TargetPortalGroupTag", portal_group_tag);
|
||||
free(portal_group_tag);
|
||||
}
|
||||
keys_save(response_keys, response);
|
||||
pdu_send(response);
|
||||
@ -1088,13 +1075,8 @@ login(struct connection *conn)
|
||||
if (conn->conn_target->t_alias != NULL)
|
||||
keys_add(response_keys,
|
||||
"TargetAlias", conn->conn_target->t_alias);
|
||||
rv = asprintf(&portal_group_tag, "%d",
|
||||
keys_add_int(response_keys, "TargetPortalGroupTag",
|
||||
conn->conn_portal->p_portal_group->pg_tag);
|
||||
if (rv <= 0)
|
||||
log_err(1, "asprintf");
|
||||
keys_add(response_keys,
|
||||
"TargetPortalGroupTag", portal_group_tag);
|
||||
free(portal_group_tag);
|
||||
}
|
||||
keys_save(response_keys, response);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user