0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Fixes problem with OSPF neighbor router ID change. Thanx to Alexander V. Chernikov

This commit is contained in:
Ondrej Filip 2013-09-13 18:55:02 +02:00
parent c404f4b968
commit e550a37206

View File

@ -101,6 +101,17 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
return; 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 (!n)
{ {
if ((ifa->type == OSPF_IT_NBMA) || (ifa->type == OSPF_IT_PTMP)) 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 = ospf_neighbor_new(ifa);
n->rid = ntohl(((struct ospf_packet *) ps)->routerid); n->rid = ntohl(ps_i->routerid);
n->ip = faddr; n->ip = faddr;
n->dr = ntohl(ps->dr); n->dr = ntohl(ps->dr);
n->bdr = ntohl(ps->bdr); n->bdr = ntohl(ps->bdr);