diff options
author | 2008-09-15 20:12:11 +0000 | |
---|---|---|
committer | 2008-09-15 20:12:11 +0000 | |
commit | fc87f19c7b421ca56c8c3d42b84e61af9e838a78 (patch) | |
tree | cbe4bd4bb108ba1c48dff9c7244a199632b42184 | |
parent | Add RTP_MASK and RTP_DOWN needed for upcomming link state tracking. (diff) | |
download | wireguard-openbsd-fc87f19c7b421ca56c8c3d42b84e61af9e838a78.tar.xz wireguard-openbsd-fc87f19c7b421ca56c8c3d42b84e61af9e838a78.zip |
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@
-rw-r--r-- | sbin/route/route.c | 8 | ||||
-rw-r--r-- | sbin/route/show.c | 4 |
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'); } |