summaryrefslogtreecommitdiff
path: root/sbin/route/route.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2005-06-09 08:07:46 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2005-06-09 08:07:46 +0000
commitd3d3f31f6930d7c13bd96dbb0ed69c291551cc74 (patch)
tree1fadd10872690130b4a194780deb26e59671c882 /sbin/route/route.c
parente352837c597422f2ea229ab6e1d02b00bdc4d0f4 (diff)
print the interface address on route get; ok henning, claudio
Diffstat (limited to 'sbin/route/route.c')
-rw-r--r--sbin/route/route.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index baafc2569ef..10aeb16dfab 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.90 2005/06/06 04:22:28 henning Exp $ */
+/* $OpenBSD: route.c,v 1.91 2005/06/09 08:07:45 markus Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -1148,7 +1148,7 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen)
void
print_getmsg(struct rt_msghdr *rtm, int msglen)
{
- struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL;
+ struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL, *ifa = NULL;
struct sockaddr_dl *ifp = NULL;
struct sockaddr_rtlabel *sa_rl = NULL;
struct sockaddr *sa;
@@ -1184,6 +1184,9 @@ print_getmsg(struct rt_msghdr *rtm, int msglen)
case RTA_NETMASK:
mask = sa;
break;
+ case RTA_IFA:
+ ifa = sa;
+ break;
case RTA_IFP:
if (sa->sa_family == AF_LINK &&
((struct sockaddr_dl *)sa)->sdl_nlen)
@@ -1211,6 +1214,8 @@ print_getmsg(struct rt_msghdr *rtm, int msglen)
if (ifp)
printf(" interface: %.*s\n",
ifp->sdl_nlen, ifp->sdl_data);
+ if (ifa)
+ printf(" if address: %s\n", routename(ifa));
printf(" flags: ");
bprintf(stdout, rtm->rtm_flags, routeflags);
printf("\n");