diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-11-08 17:03:31 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-11-08 17:04:29 +0100 |
commit | cc5b93f72db80abd1262a0a5e1d8400ceef54385 (patch) | |
tree | 42d75cb7898c6b6077e9cfbb04074cfc84e38930 /sysdep/unix/krt.Y | |
parent | 5de0e848de06a9187046dbc380d9ce6a6f8b21a2 (diff) | |
parent | f51b1f556595108d53b9f4580bfcb96bfbc85442 (diff) |
Merge tag 'v1.6.2' into int-new
Diffstat (limited to 'sysdep/unix/krt.Y')
-rw-r--r-- | sysdep/unix/krt.Y | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y index 91317d97..33dc4a19 100644 --- a/sysdep/unix/krt.Y +++ b/sysdep/unix/krt.Y @@ -29,6 +29,8 @@ CF_DECLS CF_KEYWORDS(KERNEL, PERSIST, SCAN, TIME, LEARN, DEVICE, ROUTES, GRACEFUL, RESTART, KRT_SOURCE, KRT_METRIC, MERGE, PATHS) +%type <i> kern_mp_limit + CF_GRAMMAR /* Kernel syncer protocol */ @@ -43,6 +45,11 @@ kern_proto_start: proto_start KERNEL { CF_ADDTO(kern_proto, kern_proto_start proto_name '{') CF_ADDTO(kern_proto, kern_proto kern_item ';') +kern_mp_limit: + /* empty */ { $$ = KRT_DEFAULT_ECMP_LIMIT; } + | LIMIT expr { $$ = $2; if (($2 <= 0) || ($2 > 255)) cf_error("Merge paths limit must be in range 1-255"); } + ; + kern_item: proto_item | proto_channel { this_proto->net_type = $1->net_type; } @@ -55,13 +62,18 @@ kern_item: THIS_KRT->learn = $2; #ifndef KRT_ALLOW_LEARN if ($2) - cf_error("Learning of kernel routes not supported in this configuration"); + cf_error("Learning of kernel routes not supported on this platform"); #endif } | DEVICE ROUTES bool { THIS_KRT->devroutes = $3; } | GRACEFUL RESTART bool { THIS_KRT->graceful_restart = $3; } - | MERGE PATHS bool { krt_set_merge_paths(this_channel, $3, KRT_DEFAULT_ECMP_LIMIT); } - | MERGE PATHS bool LIMIT expr { krt_set_merge_paths(this_channel, $3, $5); } + | MERGE PATHS bool kern_mp_limit { + krt_set_merge_paths(this_channel, $3, $4); +#ifndef KRT_ALLOW_MERGE_PATHS + if ($3) + cf_error("Path merging not supported on this platform"); +#endif + } ; /* Kernel interface protocol */ |