From b1003dc75ae5d5b014ecfb3f420da43b90771289 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 17 Feb 2017 17:58:19 -0800 Subject: [PATCH] Add URL arguments to enable/disable header digest Signed-off-by: Ronnie Sahlberg --- README | 1 + lib/init.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README b/README index d940a73..a36103f 100644 --- a/README +++ b/README @@ -41,6 +41,7 @@ Arguments: Username and password for bidirectional CHAP authentication: target_user= target_password= +header_digest= Transport: iser diff --git a/lib/init.c b/lib/init.c index 9ba9c1d..645b05f 100644 --- a/lib/init.c +++ b/lib/init.c @@ -571,6 +571,19 @@ iscsi_parse_url(struct iscsi_context *iscsi, const char *url, int full) if (value != NULL) { *value++ = 0; } + if (!strcmp(key, "header_digest")) { + if (!strcmp(value, "crc32c")) { + iscsi_set_header_digest( + iscsi, ISCSI_HEADER_DIGEST_CRC32C); + } else if (!strcmp(value, "none")) { + iscsi_set_header_digest( + iscsi, ISCSI_HEADER_DIGEST_NONE); + } else { + iscsi_set_error(iscsi, + "Invalid URL argument for header_digest: %s", value); + return NULL; + } + } if (!strcmp(key, "target_user")) { target_user = value; } else if (!strcmp(key, "target_password")) {