diff options
author | dwhite <dwhite@FreeBSD.org> | 1999-08-22 21:45:24 +0000 |
---|---|---|
committer | dwhite <dwhite@FreeBSD.org> | 1999-08-22 21:45:24 +0000 |
commit | 9cda01decb3256ad946657e0fc9a298213d4eaa8 (patch) | |
tree | 0de7c224091527fca4800e72ffaf6f9673980bfd /release/picobsd/tinyware/ns | |
parent | 2bbfd73cc7441111e9e49645afb397eb04b1af45 (diff) | |
download | FreeBSD-src-9cda01decb3256ad946657e0fc9a298213d4eaa8.zip FreeBSD-src-9cda01decb3256ad946657e0fc9a298213d4eaa8.tar.gz |
Major PicoBSD update by luigi with some debugging help from myself.
. Now builds on -STABLE (-CURRENT is broken due to bugs)
. etc directory contents centralized instead of in each
type directory (can exclude & override as desired)
. Removed extraneous language files (lang files for rc really necessary?)
. dialog-based build tool with support for custom floppy builds
. MFS image loads as a mfs_root module instead of compiled into kernel
THIS IS BROKEN ON CURRENT. I'll MFC to -STABLE immediately following.
luigi tells me I have an OK from jkh on the MFC.
Submitted by: luigi
Diffstat (limited to 'release/picobsd/tinyware/ns')
-rw-r--r-- | release/picobsd/tinyware/ns/ns.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/release/picobsd/tinyware/ns/ns.c b/release/picobsd/tinyware/ns/ns.c index 7f3db55..05c561e 100644 --- a/release/picobsd/tinyware/ns/ns.c +++ b/release/picobsd/tinyware/ns/ns.c @@ -135,15 +135,11 @@ sock_ntop(const struct sockaddr *sa, size_t salen) } case AF_LINK: { struct sockaddr_dl *sdl = (struct sockaddr_dl *) sa; - int l = sdl->sdl_nlen ; - if (l >= sizeof(str) ) - l = sizeof(str) - 1 ; - - if (l > 0) { - strncpy(str, &sdl->sdl_data[0], l); - str[l] = '\0'; - } else + if (sdl->sdl_nlen > 0) + snprintf(str, sizeof(str), "%*s", + sdl->sdl_nlen, &sdl->sdl_data[0]); + else snprintf(str, sizeof(str), "link#%d", sdl->sdl_index); return(str); } @@ -307,15 +303,16 @@ print_routing(char *proto) printf("----------------\n"); printf("Name Mtu Network Address " "Ipkts Ierrs Opkts Oerrs Coll\n"); - i=0; - for(next=if_buf;next<lim;next+=ifm->ifm_msglen) { + } + i=0; + for(next=if_buf;next<lim;next+=ifm->ifm_msglen) { ifm=(struct if_msghdr *)next; if_table[i]=(struct sockaddr *)(ifm+1); ifm_table[i]=ifm; sa = if_table[i]; - if (sa->sa_family == AF_LINK) { + if (iflag && sa->sa_family == AF_LINK) { struct sockaddr_dl *sdl = (struct sockaddr_dl *) sa; printf("%-4s %-5d <Link> ", @@ -336,7 +333,6 @@ print_routing(char *proto) ); } i++; - } } if (!rflag) { free(rt_buf); |