From e550a37206528be39e4751865b46720885fd64ed Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Fri, 13 Sep 2013 18:55:02 +0200 Subject: Fixes problem with OSPF neighbor router ID change. Thanx to Alexander V. Chernikov --- proto/ospf/hello.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'proto/ospf') 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); -- cgit v1.2.3