summaryrefslogtreecommitdiff
path: root/sysdep/bsd/krt-sock.Y
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/bsd/krt-sock.Y')
-rw-r--r--sysdep/bsd/krt-sock.Y10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdep/bsd/krt-sock.Y b/sysdep/bsd/krt-sock.Y
index 8581bd43..a03d6df5 100644
--- a/sysdep/bsd/krt-sock.Y
+++ b/sysdep/bsd/krt-sock.Y
@@ -10,7 +10,7 @@ CF_HDR
CF_DECLS
-CF_KEYWORDS(KERNEL, TABLE)
+CF_KEYWORDS(KERNEL, TABLE, METRIC)
CF_GRAMMAR
@@ -25,6 +25,14 @@ kern_sys_item:
THIS_KRT->sys.table_id = $3;
}
+ | METRIC expr {
+ if ($2 && !krt_max_metric)
+ cf_error("Kernel route metric not supported");
+ if ($2 > krt_max_metric)
+ cf_error("Kernel table id must be in range 0-%u", krt_max_metric);
+
+ THIS_KRT->sys.metric = $2;
+ }
;
CF_CODE