summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-09-15 20:12:12 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-09-15 20:12:12 +0000
commitb780fb8a07dee7da5d7b96e9f07b132bc15467ae (patch)
treeb1788f080b0d2a1e32c4a7a5d2e93453bc660b15 /sbin
parentef90d045629b6f9d2a2f6c69e14ce18b200a4f1f (diff)
Mask rtm->rtm_priority with RTP_MASK before printing so that the priority is
correctly shown even if the route is flagged RTP_DOWN. OK henning@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/route/route.c8
-rw-r--r--sbin/route/show.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 1463c1035a0..edd1f0f0ee5 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.119 2008/05/09 07:14:56 henning Exp $ */
+/* $OpenBSD: route.c,v 1.120 2008/09/15 20:12:11 claudio Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -1238,7 +1238,7 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen)
printf("\n");
break;
default:
- printf("priority %d, ", rtm->rtm_priority);
+ printf("priority %d, ", rtm->rtm_priority & RTP_MASK);
printf("table %u, pid: %ld, seq %d, errno %d\nflags:",
rtm->rtm_tableid, (long)rtm->rtm_pid, rtm->rtm_seq,
rtm->rtm_errno);
@@ -1250,7 +1250,7 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen)
char *
priorityname(u_int8_t prio)
{
- switch (prio) {
+ switch (prio & RTP_MASK) {
case 0:
return ("none");
case 4:
@@ -1343,7 +1343,7 @@ print_getmsg(struct rt_msghdr *rtm, int msglen)
ifp->sdl_nlen, ifp->sdl_data);
if (ifa)
printf(" if address: %s\n", routename(ifa));
- printf(" priority: %u (%s)\n", rtm->rtm_priority,
+ printf(" priority: %u (%s)\n", rtm->rtm_priority & RTP_MASK,
priorityname(rtm->rtm_priority));
printf(" flags: ");
bprintf(stdout, rtm->rtm_flags, routeflags);
diff --git a/sbin/route/show.c b/sbin/route/show.c
index 62731ebdadd..0a10bbd1f5c 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.70 2008/05/25 17:57:42 deraadt Exp $ */
+/* $OpenBSD: show.c,v 1.71 2008/09/15 20:12:11 claudio Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -308,7 +308,7 @@ p_rtentry(struct rt_msghdr *rtm)
else
printf("%5s ", "-");
putchar((rtm->rtm_rmx.rmx_locks & RTV_MTU) ? 'L' : ' ');
- printf(" %2d %.16s", rtm->rtm_priority,
+ printf(" %2d %.16s", rtm->rtm_priority & RTP_MASK,
if_indextoname(rtm->rtm_index, ifbuf));
putchar('\n');
}