From e3f506f9b53bd8e44976df1c935c7ec417793ace Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 25 Feb 2016 18:16:59 +0100 Subject: OSPF: Multicast ability is irrelevant for stub interfaces --- proto/ospf/iface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'proto/ospf') diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index 77ce839a..67ae094d 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -599,10 +599,10 @@ ospf_iface_new(struct ospf_area *oa, struct ifa *addr, struct ospf_iface_patt *i if (ospf_is_v2(p) && (ifa->type == OSPF_IT_NBMA) && (addr->flags & IA_PEER)) ifa->type = OSPF_IT_PTMP; - if ((ifa->type == OSPF_IT_BCAST) && !(iface->flags & if_multi_flag)) + if ((ifa->type == OSPF_IT_BCAST) && !(iface->flags & if_multi_flag) && !ifa->stub) ifa->type = OSPF_IT_NBMA; - if ((ifa->type == OSPF_IT_PTP) && !(iface->flags & if_multi_flag)) + if ((ifa->type == OSPF_IT_PTP) && !(iface->flags & if_multi_flag) && !ifa->stub) ifa->type = OSPF_IT_PTMP; if (ifa->type != old_type) -- cgit v1.2.3 From a459f4df16eca156cb7c6def4a758fd89c9fa504 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Wed, 9 Mar 2016 17:37:44 +0100 Subject: OSPF: Fix reading from freed memory Thanks to Pavel Tvrdik for noticing it. --- proto/ospf/neighbor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'proto/ospf') diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index c5d44dec..0223ccdf 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -108,6 +108,7 @@ ospf_neigh_down(struct ospf_neighbor *n) { struct ospf_iface *ifa = n->ifa; struct ospf_proto *p = ifa->oa->po; + u32 rid = n->rid; if ((ifa->type == OSPF_IT_NBMA) || (ifa->type == OSPF_IT_PTMP)) { @@ -121,7 +122,7 @@ ospf_neigh_down(struct ospf_neighbor *n) rem_node(NODE n); rfree(n->pool); - OSPF_TRACE(D_EVENTS, "Neighbor %R on %s removed", n->rid, ifa->ifname); + OSPF_TRACE(D_EVENTS, "Neighbor %R on %s removed", rid, ifa->ifname); } /** -- cgit v1.2.3 From 39a6b19d6d7e420805bd75783b77bf442745bccb Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 22 Mar 2016 12:51:31 +0100 Subject: OSPF: Fix bogus LSA ID collisions between received and originated LSAs After restart, LSAs locally originated by the previous instance are received from neighbors. They are installed to LSA db and flushed. If export of a route triggers origination of a new external LSA before flush of the received one is complete, the check in ospf_originate_lsa() causes origination to fail (because en->nf is NULL for the old LSA and non-NULL for the new LSA). The patch fixes this by updating the en->nf for LSAs being flushed (as is already done for empty ones). Generally, en->nf field deserves some better description in the code. Thanks to Jigar Mehta for analyzing the problem. --- proto/ospf/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'proto/ospf') diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c index 8119cfa6..7558d4a0 100644 --- a/proto/ospf/topology.c +++ b/proto/ospf/topology.c @@ -278,7 +278,7 @@ ospf_originate_lsa(struct ospf_proto *p, struct ospf_new_lsa *lsa) if (!SNODE_VALID(en)) s_add_tail(&p->lsal, SNODE en); - if (en->lsa_body == NULL) + if (!en->nf || !en->lsa_body) en->nf = lsa->nf; if (en->nf != lsa->nf) -- cgit v1.2.3