1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Implements protocol-specific Router ID for OSPF.

And fixes one minor bug.
This commit is contained in:
Ondrej Zajicek
2009-12-11 01:20:53 +01:00
parent be2d38b7e9
commit 8a70a13e7e
10 changed files with 48 additions and 59 deletions

View File

@@ -247,8 +247,8 @@ void
ospf_dbdes_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
struct ospf_neighbor *n)
{
struct proto *p = &ifa->oa->po->proto;
u32 myrid = p->cf->global->router_id;
struct proto_ospf *po = ifa->oa->po;
struct proto *p = &po->proto;
unsigned int size = ntohs(ps_i->length);
if (size < sizeof(struct ospf_dbdes_packet))
@@ -278,7 +278,7 @@ ospf_dbdes_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
return;
case NEIGHBOR_EXSTART:
if ((ps->imms.bit.m && ps->imms.bit.ms && ps->imms.bit.i)
&& (n->rid > myrid) && (size == sizeof(struct ospf_dbdes_packet)))
&& (n->rid > po->router_id) && (size == sizeof(struct ospf_dbdes_packet)))
{
/* I'm slave! */
n->dds = ps_ddseq;
@@ -293,7 +293,7 @@ ospf_dbdes_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
}
if (((ps->imms.bit.i == 0) && (ps->imms.bit.ms == 0)) &&
(n->rid < myrid) && (n->dds == ps_ddseq))
(n->rid < po->router_id) && (n->dds == ps_ddseq))
{
/* I'm master! */
n->options = ps_options;