Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/route Fix the default case in sodump(). Printing the a...



details:   https://anonhg.NetBSD.org/src/rev/ad185c523318
branches:  trunk
changeset: 583498:ad185c523318
user:      ginsbach <ginsbach%NetBSD.org@localhost>
date:      Tue Aug 09 20:33:06 2005 +0000

description:
Fix the default case in sodump().  Printing the address of the "which"
string isn't really that useful.  Instead print the string and the value
of sa_family.

diffstat:

 sbin/route/route.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 3c3dfd3defee -r ad185c523318 sbin/route/route.c
--- a/sbin/route/route.c        Tue Aug 09 19:43:24 2005 +0000
+++ b/sbin/route/route.c        Tue Aug 09 20:33:06 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.85 2005/08/09 19:43:24 ginsbach Exp $      */
+/*     $NetBSD: route.c,v 1.86 2005/08/09 20:33:06 ginsbach Exp $      */
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)route.c    8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.85 2005/08/09 19:43:24 ginsbach Exp $");
+__RCSID("$NetBSD: route.c,v 1.86 2005/08/09 20:33:06 ginsbach Exp $");
 #endif
 #endif /* not lint */
 
@@ -363,7 +363,7 @@
 #if __GNUC__ > 2
        len = sa->sa_len - offsetof(struct sockaddr, sa_data);
 #else
-       len = sa->sa_len;
+       len = sa->sa_len - ((caddr_t)&sa->sa_data - (caddr_t)sa);
 #endif
        in  = sa->sa_data;
        out = obuf;
@@ -2051,8 +2051,8 @@
                break;
 #endif /* SMALL */
        default:
-               (void)printf("af %p: %s; ",
-                       which, any_ntoa(&su->sa));
+               (void)printf("af %s: (%d) %s; ",
+                       which, su->sa.sa_family, any_ntoa(&su->sa));
        }
        (void)fflush(stdout);
 }



Home | Main Index | Thread Index | Old Index