From: Ondrej Zajicek Date: Fri, 2 May 2014 18:14:43 +0000 (+0200) Subject: Merge commit '145368f5474436ad7c48fa26f5bde8108ae5ef4a' into integrated X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=121fd43d919731a5bb1b99e736bdbc8988f20e2b;p=thirdparty%2Fbird.git Merge commit '145368f5474436ad7c48fa26f5bde8108ae5ef4a' into integrated Conflicts: proto/ospf/rt.c --- 121fd43d919731a5bb1b99e736bdbc8988f20e2b diff --cc proto/ospf/config.Y index 99031c0b2,478529bc3..2fd36bccd --- a/proto/ospf/config.Y +++ b/proto/ospf/config.Y @@@ -150,8 -160,9 +150,9 @@@ ospf_proto_item proto_item | RFC1583COMPAT bool { OSPF_CFG->rfc1583 = $2; } | STUB ROUTER bool { OSPF_CFG->stub_router = $3; } - | ECMP bool { OSPF_CFG->ecmp = $2 ? DEFAULT_ECMP_LIMIT : 0; } + | ECMP bool { OSPF_CFG->ecmp = $2 ? OSPF_DEFAULT_ECMP_LIMIT : 0; } | ECMP bool LIMIT expr { OSPF_CFG->ecmp = $2 ? $4 : 0; if ($4 < 0) cf_error("ECMP limit cannot be negative"); } + | MERGE EXTERNAL bool { OSPF_CFG->merge_external = $3; } | TICK expr { OSPF_CFG->tick = $2; if($2<=0) cf_error("Tick must be greater than zero"); } | ospf_area ; diff --cc proto/ospf/rt.c index 4dc7a5fcf,2a879c051..da117f938 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@@ -1266,15 -1591,15 +1497,14 @@@ ospf_fib_route(struct fib *f, ip_addr a static void ospf_ext_spf(struct proto_ospf *po) { + struct proto *p = &po->proto; + struct top_hash_entry *en; + struct ospf_lsa_ext_local rt; ort *nf1, *nf2; - orta nfa; + orta nfa = {}; - struct top_hash_entry *en; - struct proto *p = &po->proto; - struct ospf_lsa_ext *le; - int pxlen, ebit, rt_fwaddr_valid, rt_propagate; - ip_addr ip, rtid, rt_fwaddr; - u32 br_metric, rt_metric, rt_tag; + ip_addr rtid; + u32 br_metric; struct ospf_area *atmp; - struct mpnh* nhs = NULL; OSPF_TRACE(D_EVENTS, "Starting routing table calculation for ext routes"); @@@ -1333,14 -1688,14 +1563,14 @@@ /* 16.4. (3) NSSA - special rule for default routes */ /* ABR should use default only if P-bit is set and summaries are active */ - if ((en->lsa.type == LSA_T_NSSA) && ipa_zero(ip) && (pxlen == 0) && - (po->areano > 1) && !(rt_propagate && atmp->ac->summary)) + if ((en->lsa_type == LSA_T_NSSA) && ipa_zero(rt.ip) && (rt.pxlen == 0) && + (po->areano > 1) && !(rt.propagate && atmp->ac->summary)) continue; - if (!rt_fwaddr_valid) + if (!rt.fbit) { nf2 = nf1; - nhs = nf1->n.nhs; + nfa.nhs = nf1->n.nhs; br_metric = nf1->n.metric1; } else @@@ -1366,14 -1721,18 +1596,18 @@@ if (!nf2->n.nhs) continue; - nhs = nf2->n.nhs; - /* If gw is zero, it is a device route */ - if (ipa_zero(nhs->gw)) - nhs = new_nexthop(po, rt.fwaddr, nhs->iface, nhs->weight); + nfa.nhs = nf2->n.nhs; br_metric = nf2->n.metric1; + + /* Replace device nexthops with nexthops to forwarding address from LSA */ + if (has_device_nexthops(nfa.nhs)) + { - nfa.nhs = fix_device_nexthops(po, nfa.nhs, rt_fwaddr); ++ nfa.nhs = fix_device_nexthops(po, nfa.nhs, rt.fwaddr); + nfa.nhs_reuse = 1; + } } - if (ebit) + if (rt.ebit) { nfa.type = RTS_OSPF_EXT2; nfa.metric1 = br_metric; @@@ -1398,14 -1757,12 +1632,12 @@@ nfa.options |= ORTA_PROP; } - nfa.tag = rt_tag; + nfa.tag = rt.tag; nfa.rid = en->lsa.rt; nfa.oa = atmp; /* undefined in RFC 2328 */ - nfa.voa = NULL; - nfa.nhs = nhs; nfa.en = en; /* store LSA for later (NSSA processing) */ - ri_install_ext(po, ip, pxlen, &nfa); + ri_install_ext(po, rt.ip, rt.pxlen, &nfa); } }