[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, upstream-mnc, updated. 2.0-872-193-gde2c0e7
Mike Christie
michaelc at cs.wisc.edu
Sat Apr 7 15:44:19 UTC 2012
The following commit has been merged in the upstream-mnc branch:
commit ae94266d2a821eaea4ab66ac01e264bd69f96cda
Author: Mike Christie <michaelc at cs.wisc.edu>
Date: Thu Mar 22 23:17:21 2012 -0500
iscsi tools: fix ipv6 handling
Fix regression caused by:
commit f0eacd5e1c5691f75799c3396af66337aba5f401
iscsi tools: fix hostname with port handling
where passing a ipv6 address with no brackets [] causes the iscsi tools
to incorrectly parse part of the address as the port.
diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c
index c394fcd..5e3420e 100644
--- a/usr/iscsi_util.c
+++ b/usr/iscsi_util.c
@@ -96,10 +96,18 @@ str_to_ipport(char *str, int *port, int *tpgt)
*sport++ = '\0';
ip++;
str = sport;
- } else if (!strchr(ip, ':'))
- /* IPv6 no brackets and no port */
- sport = NULL;
- /* else hostname with domain info */
+ } else {
+ /* hostname or ipv6 */
+ sport = strchr(ip, ':');
+ if (sport) {
+ if (strchr(sport + 1, ':'))
+ /* ipv6 */
+ sport = NULL;
+ else
+ /* hostname:port */
+ str = sport;
+ }
+ }
}
if (sport && (sport = strchr(str, ':'))) {
--
Debian Open-iSCSI Packaging
More information about the Pkg-iscsi-maintainers
mailing list