Commit 4404793d authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

string: make spdk_parse_ip_addr() params non-const



The host and port output parameters point into the (non-const) char *ip,
so it makes more sense for them to be non-const as well.

This allows the flexibility to pass non-const char pointers as the
output parameters, which will be used in the nvmf_tgt/conf.c parsing
code.

Change-Id: I1d5b102fc389c06d36432904e4fda944437b659e
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent b4572d45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
	/* Parse Listen sections */
	for (i = 0; i < MAX_LISTEN_ADDRESSES; i++) {
		char *transport_name, *listen_addr;
		const char *traddr, *trsvcid;
		char *traddr, *trsvcid;
		int numa_node = -1;

		transport_name = spdk_conf_section_get_nmval(sp, "Listen", i, 0);
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ size_t spdk_strlen_pad(const void *str, size_t size, int pad);
 *
 * \return 0 if successful. -1 on error.
 */
int spdk_parse_ip_addr(char *ip, const char **host, const char **port);
int spdk_parse_ip_addr(char *ip, char **host, char **port);

#ifdef __cplusplus
}
+1 −1
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ spdk_strlen_pad(const void *str, size_t size, int pad)
}

int
spdk_parse_ip_addr(char *ip, const char **host, const char **port)
spdk_parse_ip_addr(char *ip, char **host, char **port)
{
	char *p;

+2 −2
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ static void
test_parse_ip_addr(void)
{
	int rc;
	const char *host;
	const char *port;
	char *host;
	char *port;
	char ip[255];

	/* IPv4 */