From 8a70a13e7e79afa6818b10cf64d4f1ae4cf89e4b Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 11 Dec 2009 01:20:53 +0100 Subject: Implements protocol-specific Router ID for OSPF. And fixes one minor bug. --- proto/ospf/dbdes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'proto/ospf/dbdes.c') diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c index 2cb2dd8..a249d75 100644 --- a/proto/ospf/dbdes.c +++ b/proto/ospf/dbdes.c @@ -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; -- cgit v1.2.3