summaryrefslogtreecommitdiff
path: root/proto/ospf/hello.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-08 19:27:58 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-08 19:27:58 +0100
commit8860e991f6650e47cfe6c1af595fe4fe92a4edfd (patch)
tree18f49bb3a21739a1a596b54d9f65e82cff4fc09f /proto/ospf/hello.c
parentcc5b93f72db80abd1262a0a5e1d8400ceef54385 (diff)
parentc8cafc8ebb5320ac7c6117c17e6460036f0fdf62 (diff)
Merge branch 'master' into int-new
Diffstat (limited to 'proto/ospf/hello.c')
-rw-r--r--proto/ospf/hello.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c
index 3fbb6167..2c55155d 100644
--- a/proto/ospf/hello.c
+++ b/proto/ospf/hello.c
@@ -105,7 +105,7 @@ ospf_send_hello(struct ospf_iface *ifa, int kind, struct ospf_neighbor *dirn)
}
i = 0;
- max = (ospf_pkt_maxsize(p, ifa) - length) / sizeof(u32);
+ max = (ospf_pkt_maxsize(ifa) - length) / sizeof(u32);
/* Fill all neighbors */
if (kind != OHS_SHUTDOWN)
@@ -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->prefix.pxlen))
+ ((uint) pxlen != ifa->addr->prefix.pxlen))
DROP("prefix length mismatch", pxlen);
neighbors = ps->neighbors;