Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156514342
D56335.id175205.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56335.id175205.diff
View Options
diff --git a/sbin/route/keywords b/sbin/route/keywords
--- a/sbin/route/keywords
+++ b/sbin/route/keywords
@@ -50,6 +50,7 @@
static
sticky
weight
+metric
x25
xns
xresolve
diff --git a/sbin/route/route.c b/sbin/route/route.c
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -813,6 +813,7 @@
caseof(K_RTT, RTV_RTT, rmx_rtt);
caseof(K_RTTVAR, RTV_RTTVAR, rmx_rttvar);
caseof(K_WEIGHT, RTV_WEIGHT, rmx_weight);
+ caseof(K_METRIC, RTV_METRIC, rmx_metric);
}
rtm_inits |= flag;
if (lockrest || locking)
@@ -831,6 +832,10 @@
clock_gettime(CLOCK_REALTIME_FAST, &ts);
*valp += ts.tv_sec;
}
+ if (flag & RTV_METRIC && *valp > RT_MAX_METRIC)
+ errno = EINVAL;
+ if (flag & RTV_WEIGHT && *valp > RT_MAX_WEIGHT)
+ errno = EINVAL;
}
#define F_ISHOST 0x01
@@ -999,6 +1004,7 @@
case K_RTT:
case K_RTTVAR:
case K_WEIGHT:
+ case K_METRIC:
if (!--argc)
usage(NULL);
set_metric(*++argv, key);
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c
--- a/sbin/route/route_netlink.c
+++ b/sbin/route/route_netlink.c
@@ -270,6 +270,8 @@
if (rt_metrics->rmx_expire > 0)
snl_add_msg_attr_u32(&nw, NL_RTA_EXPIRES, rt_metrics->rmx_expire);
+ if (rt_metrics->rmx_metric > 0)
+ snl_add_msg_attr_u8(&nw, NL_RTA_PRIORITY, rt_metrics->rmx_metric);
if (rt_metrics->rmx_weight > 0)
snl_add_msg_attr_u32(&nw, NL_RTA_WEIGHT, rt_metrics->rmx_weight);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 15, 7:45 AM (12 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33076940
Default Alt Text
D56335.id175205.diff (1 KB)
Attached To
Mode
D56335: route(8): Add metric argument
Attached
Detach File
Event Timeline
Log In to Comment