aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-08-10 13:59:22 -0400
committerBill Nottingham <notting@redhat.com>2009-08-10 13:59:22 -0400
commita95935d72ff61edba2002cffebc6a247f6dae5e5 (patch)
tree95df28edff88ba62e528f9cbb393c47f3d0b72fd /src
parente3ab05b8df753840a470d4c0f1f65632ea2fb18a (diff)
downloadinitscripts-a95935d72ff61edba2002cffebc6a247f6dae5e5.tar
initscripts-a95935d72ff61edba2002cffebc6a247f6dae5e5.tar.gz
initscripts-a95935d72ff61edba2002cffebc6a247f6dae5e5.tar.bz2
initscripts-a95935d72ff61edba2002cffebc6a247f6dae5e5.tar.xz
initscripts-a95935d72ff61edba2002cffebc6a247f6dae5e5.zip
Fix IPv6 address checking (#516319)
Diffstat (limited to 'src')
-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;