summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-03-23 13:43:33 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-03-23 13:43:33 +0000
commit28184fb7f5e7da200928485e042a0082c6fa1e91 (patch)
tree3ed777e303f7ce9477bbf27c41eda64e5f834b06 /sbin
parent828a8e94e535289629e8ad633582239b61b239de (diff)
Only print the routing table id if the routing message uses the rt_msghdr
else some random value is printed for messages like RTM_NEWADDR. OK henning@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/route/route.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index b75cfa2550a..bd9922efcd8 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.104 2006/11/28 19:21:15 reyk Exp $ */
+/* $OpenBSD: route.c,v 1.105 2007/03/23 13:43:32 claudio Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -1136,8 +1136,7 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen)
rtm->rtm_version);
return;
}
- printf("%s: len %d, table %u, ", msgtypes[rtm->rtm_type],
- rtm->rtm_msglen, rtm->rtm_tableid);
+ printf("%s: len %d, ", msgtypes[rtm->rtm_type], rtm->rtm_msglen);
switch (rtm->rtm_type) {
case RTM_IFINFO:
ifm = (struct if_msghdr *)rtm;
@@ -1175,8 +1174,9 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen)
printf("\n");
break;
default:
- printf("pid: %ld, seq %d, errno %d, flags:",
- (long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno);
+ printf("table: %u, pid: %ld, seq %d, errno %d, flags:",
+ rtm->rtm_tableid, (long)rtm->rtm_pid, rtm->rtm_seq,
+ rtm->rtm_errno);
bprintf(stdout, rtm->rtm_flags, routeflags);
pmsg_common(rtm);
}