|
@@ -1921,6 +1921,7 @@ static int iscsi_parse_root_path ( struct iscsi_session *iscsi,
|
1921
|
1921
|
char rp_copy[ strlen ( root_path ) + 1 ];
|
1922
|
1922
|
char *rp_comp[NUM_RP_COMPONENTS];
|
1923
|
1923
|
char *rp = rp_copy;
|
|
1924
|
+ int skip = 0;
|
1924
|
1925
|
int i = 0;
|
1925
|
1926
|
int rc;
|
1926
|
1927
|
|
|
@@ -1930,11 +1931,15 @@ static int iscsi_parse_root_path ( struct iscsi_session *iscsi,
|
1930
|
1931
|
rp_comp[i++] = rp;
|
1931
|
1932
|
if ( i == NUM_RP_COMPONENTS )
|
1932
|
1933
|
break;
|
1933
|
|
- for ( ; *rp != ':' ; rp++ ) {
|
|
1934
|
+ for ( ; ( ( *rp != ':' ) || skip ) ; rp++ ) {
|
1934
|
1935
|
if ( ! *rp ) {
|
1935
|
1936
|
DBGC ( iscsi, "iSCSI %p root path \"%s\" "
|
1936
|
1937
|
"too short\n", iscsi, root_path );
|
1937
|
1938
|
return -EINVAL_ROOT_PATH_TOO_SHORT;
|
|
1939
|
+ } else if ( *rp == '[' ) {
|
|
1940
|
+ skip = 1;
|
|
1941
|
+ } else if ( *rp == ']' ) {
|
|
1942
|
+ skip = 0;
|
1938
|
1943
|
}
|
1939
|
1944
|
}
|
1940
|
1945
|
*(rp++) = '\0';
|