]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '145368f5474436ad7c48fa26f5bde8108ae5ef4a' into integrated
authorOndrej Zajicek <santiago@crfreenet.org>
Fri, 2 May 2014 18:14:43 +0000 (20:14 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Fri, 2 May 2014 18:14:43 +0000 (20:14 +0200)
Conflicts:

proto/ospf/rt.c

1  2 
proto/ospf/config.Y
proto/ospf/ospf.c
proto/ospf/rt.c
proto/ospf/rt.h

index 99031c0b29b02f4ddce55eae8db9febd5a95de49,478529bc3774ac333c8d79acf5c5006cd324ca4b..2fd36bccd02549f024d315d9e6f6a43a68ad31dd
@@@ -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
   ;
Simple merge
diff --cc proto/ospf/rt.c
index 4dc7a5fcf950d2fc9f3c713c24d50025d584d795,2a879c051a688566aaae7c283935ac3eec6954b0..da117f938a50521af240a107f2d35bdd228646db
@@@ -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");
  
  
      /* 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
        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;
 -      nfa.nhs = fix_device_nexthops(po, nfa.nhs, rt_fwaddr);
+       /* 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_reuse = 1;
+       }
      }
  
 -    if (ebit)
 +    if (rt.ebit)
      {
        nfa.type = RTS_OSPF_EXT2;
        nfa.metric1 = br_metric;
        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);
    }
  }
  
diff --cc proto/ospf/rt.h
Simple merge