=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/netstat/route.c,v retrieving revision 1.67 retrieving revision 1.68 diff -c -r1.67 -r1.68 *** src/usr.bin/netstat/route.c 2005/03/25 17:01:04 1.67 --- src/usr.bin/netstat/route.c 2005/03/30 08:23:47 1.68 *************** *** 1,4 **** ! /* $OpenBSD: route.c,v 1.67 2005/03/25 17:01:04 jaredy Exp $ */ /* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: route.c,v 1.68 2005/03/30 08:23:47 jaredy Exp $ */ /* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */ /* *************** *** 34,40 **** #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else ! static char *rcsid = "$OpenBSD: route.c,v 1.67 2005/03/25 17:01:04 jaredy Exp $"; #endif #endif /* not lint */ --- 34,40 ---- #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else ! static char *rcsid = "$OpenBSD: route.c,v 1.68 2005/03/30 08:23:47 jaredy Exp $"; #endif #endif /* not lint */ *************** *** 110,116 **** { RTF_PROTO2, '2' }, { RTF_PROTO3, '3' }, { RTF_CLONED, 'c' }, - { RTF_SOURCE, 's' }, { 0 } }; --- 110,115 ---- *************** *** 137,143 **** static void p_flags(int, char *); static void p_rtentry(struct rtentry *); static void encap_print(struct rtentry *); - static void sa_src2dst(struct sockaddr *); /* * Print routing tables. --- 136,141 ---- *************** *** 249,260 **** if (Aflag) printf("%-*.*s ", PLEN, PLEN, "Address"); ! if (Sflag) ! printf("%-*.*s ", ! WID_DST(af), WID_DST(af), "Source"); ! printf("%-*.*s ", ! WID_DST(af), WID_DST(af), "Destination"); ! printf("%-*.*s %-6.6s %6.6s %6.6s %6.6s %s\n", WID_GW(af), WID_GW(af), "Gateway", "Flags", "Refs", "Use", "Mtu", "Interface"); } --- 247,254 ---- if (Aflag) printf("%-*.*s ", PLEN, PLEN, "Address"); ! printf("%-*.*s %-*.*s %-6.6s %6.6s %6.6s %6.6s %s\n", ! WID_DST(af), WID_DST(af), "Destination", WID_GW(af), WID_GW(af), "Gateway", "Flags", "Refs", "Use", "Mtu", "Interface"); } *************** *** 631,643 **** } else mask = 0; - if (Sflag && sa->sa_family == AF_INET) { - sa_src2dst(sa); - sa_src2dst(mask); - p_sockaddr(sa, mask, rt->rt_flags, WID_DST(sa->sa_family)); - sa_src2dst(sa); - sa_src2dst(mask); - } p_sockaddr(sa, mask, rt->rt_flags, WID_DST(sa->sa_family)); p_sockaddr(kgetsa(rt->rt_gateway), 0, RTF_HOST, WID_GW(sa->sa_family)); p_flags(rt->rt_flags, "%-6.6s "); --- 625,630 ---- *************** *** 1151,1168 **** case 'f': *p += ('A' - 'a'); break; - } - } - - void - sa_src2dst(struct sockaddr *sa) - { - struct sockaddr_rtin *rtin = satortin(sa); - struct in_addr tmp; - - if (sa != NULL) { - tmp = rtin->rtin_dst; - rtin->rtin_dst = rtin->rtin_src; - rtin->rtin_src = tmp; } } --- 1138,1142 ----