summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/krt.Y12
-rw-r--r--sysdep/unix/krt.c9
-rw-r--r--sysdep/unix/krt.h1
3 files changed, 10 insertions, 12 deletions
diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y
index 31f5f1d4..9aac8668 100644
--- a/sysdep/unix/krt.Y
+++ b/sysdep/unix/krt.Y
@@ -17,16 +17,6 @@ CF_DEFINES
#define KIF_IFACE ((struct kif_iface_config *) this_ipatt)
static void
-krt_set_merge_paths(struct channel_config *cc, uint merge, uint limit)
-{
- if ((limit <= 0) || (limit > 255))
- cf_error("Merge paths limit must be in range 1-255");
-
- cc->ra_mode = merge ? RA_MERGED : RA_OPTIMAL;
- cc->merge_limit = limit;
-}
-
-static void
kif_set_preferred(ip_addr ip)
{
if (ipa_is_ip4(ip))
@@ -80,7 +70,7 @@ kern_item:
}
| GRACEFUL RESTART bool { THIS_KRT->graceful_restart = $3; }
| MERGE PATHS bool kern_mp_limit {
- krt_set_merge_paths(this_channel, $3, $4);
+ THIS_KRT->merge_paths = $3 ? $4 : 0;
#ifndef KRT_ALLOW_MERGE_PATHS
if ($3)
cf_error("Path merging not supported on this platform");
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index d4c0db72..bfdbfa4e 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -1059,11 +1059,18 @@ krt_postconfig(struct proto_config *CF)
cf_error("All kernel syncers must use the same table scan interval");
#endif
- struct rtable_config *tab = proto_cf_main_channel(CF)->table;
+ struct channel_config *cc = proto_cf_main_channel(CF);
+ struct rtable_config *tab = cc->table;
if (tab->krt_attached)
cf_error("Kernel syncer (%s) already attached to table %s", tab->krt_attached->name, tab->name);
tab->krt_attached = CF;
+ if (cf->merge_paths)
+ {
+ cc->ra_mode = RA_MERGED;
+ cc->merge_limit = cf->merge_paths;
+ }
+
krt_sys_postconfig(cf);
}
diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
index 8d3add0e..b627882d 100644
--- a/sysdep/unix/krt.h
+++ b/sysdep/unix/krt.h
@@ -50,6 +50,7 @@ struct krt_config {
int persist; /* Keep routes when we exit */
int learn; /* Learn routes from other sources */
int graceful_restart; /* Regard graceful restart recovery */
+ int merge_paths; /* Exported routes are merged for ECMP */
};
struct krt_proto {