summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_proto.c')
-rw-r--r--ospf6d/ospf6_proto.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ospf6d/ospf6_proto.c b/ospf6d/ospf6_proto.c
index 7ee7e0a7..5b47cf80 100644
--- a/ospf6d/ospf6_proto.c
+++ b/ospf6d/ospf6_proto.c
@@ -36,12 +36,15 @@ ospf6_prefix_apply_mask (struct ospf6_prefix *op)
offset = op->prefix_length % 8;
mask = 0xff << (8 - offset);
- if (index >= 16)
+ if (index > 16)
{
- zlog_warn ("Apply mask to ospf6_prefix failed");
+ zlog_warn ("Prefix length too long: %d", op->prefix_length);
return;
}
+ if (index == 16)
+ return;
+
pnt[index] &= mask;
index ++;