cf->net_type = net_type;
cf->ra_mode = RA_OPTIMAL;
- cf->preference = proto->protocol->preference;
+ cf->preference = 250 - proto->protocol->preference;
add_tail(&proto->channels, &cf->n);
/*
* Default protocol preferences
+ * (effective values are 250-X of these)
*/
#define DEF_PREF_DIRECT 240 /* Directly connected */
if (!rte_is_valid(new))
return 0;
- if (new->pref > old->pref)
- return 1;
if (new->pref < old->pref)
+ return 1;
+ if (new->pref > old->pref)
return 0;
if (new->attrs->src->proto->proto != old->attrs->src->proto->proto)
{
rte *rte = rte_get_temp(a);
memset(&rte->u.babel, 0, sizeof(rte->u.babel));
rte->pflags = 0;
- rte->pref = 1;
+ rte->pref = 65535;
e->unreachable = 1;
rte_update2(c, e->n.addr, rte, p->p.main_source);