diff options
author | Jared Yanovich <jaredy@cvs.openbsd.org> | 2004-09-21 02:45:53 +0000 |
---|---|---|
committer | Jared Yanovich <jaredy@cvs.openbsd.org> | 2004-09-21 02:45:53 +0000 |
commit | 1ba3f9497bb457569d1c99f009f1243804723a6b (patch) | |
tree | e72b33047733bbffad4f0483b4d3d3ab22b64d25 /sbin | |
parent | d207dd524effba19f5a142afe2accf9753eada25 (diff) |
print route labels in monitor mode. ok henning
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/route/show.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index b0cf33a663d..cc110a8da4f 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.34 2004/09/15 23:41:42 deraadt Exp $ */ +/* $OpenBSD: show.c,v 1.35 2004/09/21 02:45:52 jaredy Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else -static const char rcsid[] = "$OpenBSD: show.c,v 1.34 2004/09/15 23:41:42 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: show.c,v 1.35 2004/09/21 02:45:52 jaredy Exp $"; #endif #endif /* not lint */ @@ -425,6 +425,16 @@ routename(struct sockaddr *sa) case AF_LINK: return (link_print(sa)); + case AF_UNSPEC: + if (sa->sa_len == sizeof(struct sockaddr_rtlabel)) { + static char name[RTLABEL_LEN]; + struct sockaddr_rtlabel *sr; + + sr = (struct sockaddr_rtlabel *)sa; + (void) strlcpy(name, sr->sr_label, sizeof name); + return (name); + } + /* FALLTHROUGH */ default: (void) snprintf(line, sizeof line, "(%d) %s", sa->sa_family, any_ntoa(sa)); |