From cf31112f0d7618464097f71228f84bd534f1bc0f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 3 Jan 2010 12:17:52 +0100 Subject: Implements MRTdump feature. --- proto/ospf/iface.c | 9 ++++++--- proto/ospf/neighbor.c | 6 +++--- proto/ospf/ospf.c | 4 ++-- proto/ospf/topology.c | 6 ++++-- 4 files changed, 15 insertions(+), 10 deletions(-) (limited to 'proto/ospf') diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index 8db086e..e514a5d 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -152,9 +152,12 @@ ospf_iface_chstate(struct ospf_iface *ifa, u8 state) if ((ifa->type != OSPF_IT_NBMA) && (ifa->ioprob == OSPF_I_OK) && ((state == OSPF_IS_BACKUP) || (state == OSPF_IS_DR))) { - /* FIXME some error handing ? */ - sk_join_group(ifa->sk, AllDRouters); - ifa->dr_up = 1; + if (!ifa->dr_up == 0) + { + /* FIXME some error handing ? */ + sk_join_group(ifa->sk, AllDRouters); + ifa->dr_up = 1; + } } else if (ifa->dr_up) { diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index ba8d7b9..0411d48 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -623,9 +623,9 @@ ospf_sh_neigh_info(struct ospf_neighbor *n) if ((n->ifa->type == OSPF_IT_PTP) || (n->ifa->type == OSPF_IT_VLINK)) pos = "ptp "; - cli_msg(-1013, "%-1R\t%3u\t%s/%s\t%-5s\t%-1I\t%-10s", n->rid, n->priority, - ospf_ns[n->state], pos, etime, n->ip, - (ifa->type == OSPF_IT_VLINK ? "vlink" : ifa->iface->name)); + cli_msg(-1013, "%-1R\t%3u\t%s/%s\t%-5s\t%-10s %-1I", n->rid, n->priority, + ospf_ns[n->state], pos, etime, + (ifa->type == OSPF_IT_VLINK ? "vlink" : ifa->iface->name), n->ip); } static void diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 9ebef6b..232803d 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -917,8 +917,8 @@ ospf_sh_neigh(struct proto *p, char *iff) } cli_msg(-1013, "%s:", p->name); - cli_msg(-1013, "%-12s\t%3s\t%-15s\t%-5s\t%-12s\t%-10s", "Router ID", "Pri", - " State", "DTime", "Router IP", "Interface"); + cli_msg(-1013, "%-12s\t%3s\t%-15s\t%-5s\t%-10s %-12s", "Router ID", "Pri", + " State", "DTime", "Interface", "Router IP"); WALK_LIST(ifa, po->iface_list) if ((iff == NULL) || patmatch(iff, ifa->iface->name)) WALK_LIST(n, ifa->neigh_list) diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c index 3ca5e77..870c0bc 100644 --- a/proto/ospf/topology.c +++ b/proto/ospf/topology.c @@ -433,9 +433,11 @@ originate_rt_lsa(struct ospf_area *oa) #ifdef OSPFv2 lsa.options = oa->options; -#endif - lsa.id = po->router_id; +#else /* OSPFv3 */ + lsa.id = 0; +#endif + lsa.rt = po->router_id; lsa.sn = oa->rt ? (oa->rt->lsa.sn + 1) : LSA_INITSEQNO; u32 dom = oa->areaid; -- cgit v1.2.3