summaryrefslogtreecommitdiff
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2013-09-13 18:55:02 +0200
committerOndrej Filip <feela@network.cz>2013-09-13 18:55:02 +0200
commite550a37206528be39e4751865b46720885fd64ed (patch)
tree4f5ded9c26c1a009a3b12b728cdbbe800ae4b76e /proto/ospf
parentc404f4b968b69a2c5c1975d04abf7474891d5656 (diff)
Fixes problem with OSPF neighbor router ID change. Thanx to Alexander V. Chernikov
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/hello.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c
index d5aa1b95..58e87bbf 100644
--- a/proto/ospf/hello.c
+++ b/proto/ospf/hello.c
@@ -101,6 +101,17 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
return;
}
+#ifdef OSPFv2
+ if (n && (n->rid != ntohl(ps_i->routerid)))
+ {
+ OSPF_TRACE(D_EVENTS,
+ "Neighbor %I has changed router id from %R to %R.",
+ n->ip, n->rid, ntohl(ps_i->routerid));
+ ospf_neigh_remove(n);
+ n = NULL;
+ }
+#endif
+
if (!n)
{
if ((ifa->type == OSPF_IT_NBMA) || (ifa->type == OSPF_IT_PTMP))
@@ -132,7 +143,7 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
n = ospf_neighbor_new(ifa);
- n->rid = ntohl(((struct ospf_packet *) ps)->routerid);
+ n->rid = ntohl(ps_i->routerid);
n->ip = faddr;
n->dr = ntohl(ps->dr);
n->bdr = ntohl(ps->bdr);