diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-08 10:40:00 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-08 10:40:00 +0000 |
commit | 916c8c0abacfd5ba93353fec9dba84a81845c95e (patch) | |
tree | 8d0abb12434e6e0b9ea3304f799504a298e17003 | |
parent | 1151401e2b8b4434bbd1419ff33a48f2848d600d (diff) |
Use preferences properly.
-rw-r--r-- | nest/route.h | 4 | ||||
-rw-r--r-- | proto/ospf/config.Y | 1 | ||||
-rw-r--r-- | proto/ospf/rt.c | 1 | ||||
-rw-r--r-- | sysdep/unix/krt.Y | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/nest/route.h b/nest/route.h index c36cde6d..66a32ed9 100644 --- a/nest/route.h +++ b/nest/route.h @@ -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 diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y index 1edaeb0c..dcd7500e 100644 --- a/proto/ospf/config.Y +++ b/proto/ospf/config.Y @@ -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; } ; diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 19503428..7c7d46e3 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -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); diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y index b5ca3c0b..11fd0c01 100644 --- a/sysdep/unix/krt.Y +++ b/sysdep/unix/krt.Y @@ -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); |