Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/ifconfig Revert last change. getnameinfo() AF_LINK sup...
details: https://anonhg.NetBSD.org/src/rev/55cbe4de8aae
branches: trunk
changeset: 515835:55cbe4de8aae
user: bjh21 <bjh21%NetBSD.org@localhost>
date: Fri Oct 05 20:50:19 2001 +0000
description:
Revert last change. getnameinfo() AF_LINK support is going away until I can
make it lint-clean.
diffstat:
sbin/ifconfig/ifconfig.c | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diffs (77 lines):
diff -r ca795351dadc -r 55cbe4de8aae sbin/ifconfig/ifconfig.c
--- a/sbin/ifconfig/ifconfig.c Fri Oct 05 19:05:05 2001 +0000
+++ b/sbin/ifconfig/ifconfig.c Fri Oct 05 20:50:19 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ifconfig.c,v 1.117 2001/10/04 23:12:22 bjh21 Exp $ */
+/* $NetBSD: ifconfig.c,v 1.118 2001/10/05 20:50:19 bjh21 Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-__RCSID("$NetBSD: ifconfig.c,v 1.117 2001/10/04 23:12:22 bjh21 Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.118 2001/10/05 20:50:19 bjh21 Exp $");
#endif
#endif /* not lint */
@@ -315,7 +315,7 @@
void list_cloners __P((void));
void printb __P((const char *, unsigned short, const char *));
int prefix __P((void *, int));
-void status __P((const struct sockaddr_dl *));
+void status __P((const u_int8_t *, int));
void usage __P((void));
const char *get_string __P((const char *, const char *, u_int8_t *, int *));
void print_string __P((const u_int8_t *, int));
@@ -783,8 +783,12 @@
continue;
}
- status(sdl);
- sdl = NULL;
+ if (sdl == NULL) {
+ status(NULL, 0);
+ } else {
+ status(LLADDR(sdl), sdl->sdl_alen);
+ sdl = NULL;
+ }
}
if (lflag)
putchar('\n');
@@ -1851,13 +1855,13 @@
* specified, show it and it only; otherwise, show them all.
*/
void
-status(sdl)
- const struct sockaddr_dl *sdl;
+status(ap, alen)
+ const u_int8_t *ap;
+ int alen;
{
struct afswtch *p = afp;
struct ifmediareq ifmr;
int *media_list, i;
- char hbuf[NI_MAXHOST];
printf("%s: ", name);
printb("flags", flags, IFFBITS);
@@ -1881,11 +1885,12 @@
vlan_status();
tunnel_status();
- if (sdl != NULL &&
- getnameinfo((struct sockaddr *)sdl, sdl->sdl_len,
- hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) == 0 &&
- hbuf[0] != '\0')
- printf("\taddress: %s\n", hbuf);
+ if (ap && alen > 0) {
+ printf("\taddress:");
+ for (i = 0; i < alen; i++, ap++)
+ printf("%c%02x", i > 0 ? ':' : ' ', *ap);
+ putchar('\n');
+ }
(void) memset(&ifmr, 0, sizeof(ifmr));
(void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
Home |
Main Index |
Thread Index |
Old Index