summaryrefslogtreecommitdiff
path: root/proto/ospf/hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf/hello.c')
-rw-r--r--proto/ospf/hello.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c
index 50cf1407..e00487dc 100644
--- a/proto/ospf/hello.c
+++ b/proto/ospf/hello.c
@@ -222,9 +222,12 @@ ospf_receive_hello(struct ospf_packet *pkt, struct ospf_iface *ifa,
rcv_priority = ps->priority;
int pxlen = u32_masklen(ntohl(ps->netmask));
+ if (pxlen < 0)
+ DROP("prefix garbled", ntohl(ps->netmask));
+
if ((ifa->type != OSPF_IT_VLINK) &&
(ifa->type != OSPF_IT_PTP) &&
- (pxlen != ifa->addr->pxlen))
+ ((uint) pxlen != ifa->addr->pxlen))
DROP("prefix length mismatch", pxlen);
neighbors = ps->neighbors;