Changeset 449


Ignore:
Timestamp:
May 1, 2014, 10:10:47 AM (11 years ago)
Author:
katerina
Message:

More fixes for ticket #350 (ipv6 this time).

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r448 r449  
    1 3.1.1:
     13.1.1 (01-0-2014):
    22        * Disable inline asm on Cygwin (issue reported by Erik)
    33        * Fix sh_ipvx_is_ipv4 such that numeric hostnames are not
    44          incorrectly recognised as IP address (reported by A. Hofland)
     5        * Fix sh_ipvx_is_ipv6
    56
    673.1.0 (31-10-2013):
  • trunk/src/cutest_sh_tools.c

    r448 r449  
    115115  input  = strdup("127");
    116116  CuAssertTrue(tc, !sh_ipvx_is_numeric(input));
     117#if defined(USE_IPVX)
     118  input  = strdup("::1");
     119  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     120  input  = strdup("2002:c0a8:101::42");
     121  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     122  input  = strdup("2003:dead:beef:4dad:23:46:bb:101");
     123  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     124  input  = strdup("::192:168:0:1::");
     125  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     126  input  = strdup("1:1:192:168:0:1:1:1");
     127  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     128  input  = strdup("1:1:192:168:0:1:1:1:0");
     129  CuAssertTrue(tc, !sh_ipvx_is_numeric(input));
     130  input  = strdup("2001:0db8:85a3:0000:0000:8a2e:0370:7334");
     131  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     132  input  = strdup("2001:db8:85a3:0:0:8a2e:370:7334");
     133  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     134  input  = strdup("2001:db8:85a3::8a2e:370:7334");
     135  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
     136#endif
    117137}
    118138
  • trunk/src/sh_ipvx.c

    r448 r449  
    8282    else if (c == ':')
    8383      ++k;
    84     else if (c == '.' && k < 3)
     84    else if (c == '.' && k < 2)
    8585      return (1 == 0); /* ::ffff:ipv4 */
    8686  }
     87  if (k < 2 || k > 7)
     88    return (1 == 0);
     89
    8790  return (1 == 1);
    8891}
Note: See TracChangeset for help on using the changeset viewer.