diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-05-06 03:44:15 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-05-06 03:44:15 +0000 |
commit | 60c2728fe21cc9532441ef9e7c148a77f3e018f4 (patch) | |
tree | c540f12def504d205e6912634f2dbf1aa3a128df /sbin/route/show.c | |
parent | 59da55eb67dd5d28f755f52a2b83354bf6b27a9f (diff) |
Labels in the sockaddr are stored like on the wire so shift and byte swap
them. This makes route lookups work again. OK norby@
Diffstat (limited to 'sbin/route/show.c')
-rw-r--r-- | sbin/route/show.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index 586645a8026..a082bd66868 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.64 2008/05/06 03:39:09 claudio Exp $ */ +/* $OpenBSD: show.c,v 1.65 2008/05/06 03:44:14 claudio Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -877,11 +877,13 @@ label_print(struct sockaddr *sa) char *in_label; char *out_label; - if (asprintf(&in_label, "%u%%%s", ntohl(smpls->smpls_in_label), + if (asprintf(&in_label, "%u%%%s", + ntohl(smpls->smpls_in_label) >> MPLS_LABEL_OFFSET, if_indextoname(smpls->smpls_in_ifindex, ifname_in)) == -1) err(1, NULL); - if (asprintf(&out_label, "%u%%%s", ntohl(smpls->smpls_out_label), + if (asprintf(&out_label, "%u%%%s", + ntohl(smpls->smpls_out_label) >> MPLS_LABEL_OFFSET, if_indextoname(smpls->smpls_out_ifindex, ifname_out)) == -1) err(1, NULL); |