]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Use preferences properly.
authorMartin Mares <mj@ucw.cz>
Mon, 8 May 2000 10:40:00 +0000 (10:40 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 8 May 2000 10:40:00 +0000 (10:40 +0000)
nest/route.h
proto/ospf/config.Y
proto/ospf/rt.c
sysdep/unix/krt.Y

index c36cde6d430c21bf641ac5e44a002b8843117761..66a32ed98fb9f9a9025bddcee803c25136d818b8 100644 (file)
@@ -351,10 +351,10 @@ extern struct protocol *attr_class_to_protocol[EAP_MAX];
 
 #define DEF_PREF_DIRECT                240     /* Directly connected */
 #define DEF_PREF_STATIC                200     /* Static route */
-#define DEF_PREF_OSPF_INTERNAL 150     /* OSPF intra-area, inter-area and type 1 external routes */
+#define DEF_PREF_OSPF          150     /* OSPF intra-area, inter-area and type 1 external routes */
 #define DEF_PREF_RIP           120     /* RIP */
 #define DEF_PREF_BGP           100     /* BGP */
-#define DEF_PREF_OSPF_EXTERNAL 80      /* OSPF external routes */
 #define DEF_PREF_PIPE          70      /* Routes piped from other tables */
+#define DEF_PREF_INHERITED     10      /* Routes inherited from other routing daemons */
 
 #endif
index 1edaeb0c5863ad5b1a8ec93710df130a245b2a40..dcd7500efa4ae03db16ea62a4d21a470a988bab8 100644 (file)
@@ -20,6 +20,7 @@ CF_ADDTO(proto, ospf_proto '}')
 
 ospf_proto_start: proto_start OSPF {
      this_proto = proto_config_new(&proto_ospf, sizeof(struct ospf_config));
+     this_proto->preference = DEF_PREF_OSPF;
   }
  ;
 
index 195034284bb80fbe0c78d7632560441def059738..7c7d46e3a6c461b37c3a42447659e66e32b743c6 100644 (file)
@@ -211,6 +211,7 @@ again:
         e->u.ospf.tag=0;                       /* FIXME Some config? */
         e->pflags = 0;
         e->net=ne;
+       e->pref = p->preference;
         DBG("Modifying rt entry %I\n     (IP: %I, GW: %I, Iface: %s)\n",
           nf->fn.prefix,ip,en->nh,en->nhi->name);
         rte_update(p->table, ne, p, e);
index b5ca3c0b7c49c7f0d4dc4a93bc718c45fd7f6ea8..11fd0c01ac7165d5e456c0fe81e89261f125a1f9 100644 (file)
@@ -31,7 +31,7 @@ kern_proto_start: proto_start KERNEL {
        cf_error("Kernel protocol already defined");
 #endif
      cf_krt = this_proto = proto_config_new(&proto_unix_kernel, sizeof(struct krt_config));
-     this_proto->preference = 0;
+     this_proto->preference = DEF_PREF_INHERITED;
      THIS_KRT->scan_time = 60;
      THIS_KRT->learn = THIS_KRT->persist = 0;
      krt_scan_construct(THIS_KRT);