aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/ipcalc-tests1
-rw-r--r--src/ipcalc.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/ipcalc-tests b/src/ipcalc-tests
index 53019cf4..ebb777d3 100755
--- a/src/ipcalc-tests
+++ b/src/ipcalc-tests
@@ -68,6 +68,7 @@ TestSuccess "$bin -c -6 2a01:198:200:300::2"
TestSuccess "$bin -c -6 2a01:198:200:300:0000:0000:0000:2"
TestSuccess "$bin -c -6 2a01:0198:0200:0300:0000:0000:0000:0002"
TestSuccess "$bin -c -6 ::1/128"
+TestSuccess "$bin -c -6 fec0::1:0:0:c0a8:8002/64"
TestFailure "$bin -c -6 gggg::"
TestFailure "$bin -b -6 ::1/128"
diff --git a/src/ipcalc.c b/src/ipcalc.c
index 6f1be64b..c93e8329 100644
--- a/src/ipcalc.c
+++ b/src/ipcalc.c
@@ -336,7 +336,7 @@ int main(int argc, const char **argv) {
}
/* Handle CIDR entries such as 172/8 */
- if (prefix >= 0) {
+ if (prefix >= 0 && familyIPv4) {
char *tmp = ipStr;
int i;