diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1998-03-20 02:22:30 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1998-03-20 02:22:30 +0000 |
commit | 78aa73f009d8283b90e504cf5089313e8dfd7b14 (patch) | |
tree | d6a7b20e6dd91be8b5a516fccbf4441d1ca8b3d4 /sbin/ifconfig/ifconfig.c | |
parent | 956d59bce8d3dc78b2d2a58efa66abb203662507 (diff) |
Pay attention.
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 294319bbcbf..6d8a3a59fd5 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.14 1998/03/20 02:13:28 angelos Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.15 1998/03/20 02:22:29 angelos Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; #else -static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.14 1998/03/20 02:13:28 angelos Exp $"; +static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.15 1998/03/20 02:22:29 angelos Exp $"; #endif #endif /* not lint */ @@ -597,7 +597,7 @@ in_status(force) } strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); sin = (struct sockaddr_in *)&ifr.ifr_addr; - bcopy(&ifr.ifr_addr, &sin2, sizeof(sin2)); + memcpy(&sin2, &ifr.ifr_addr, sizeof(sin2)); printf("\tinet %s ", inet_ntoa(sin->sin_addr)); strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); if (ioctl(s, SIOCGIFNETMASK, (caddr_t)&ifr) < 0) { @@ -608,6 +608,7 @@ in_status(force) netmask.sin_addr = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr; if (flags & IFF_POINTOPOINT) { + memcpy(&ifr.ifr_addr, &sin2, sizeof(sin2)); if (ioctl(s, SIOCGIFDSTADDR, (caddr_t)&ifr) < 0) { if (errno == EADDRNOTAVAIL) memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr)); @@ -620,7 +621,7 @@ in_status(force) } printf("netmask 0x%x ", ntohl(netmask.sin_addr.s_addr)); if (flags & IFF_BROADCAST) { - bcopy(&sin2, &ifr.ifr_addr, sizeof(sin2)); + memcpy(&ifr.ifr_addr, &sin2, sizeof(sin2)); if (ioctl(s, SIOCGIFBRDADDR, (caddr_t)&ifr) < 0) { if (errno == EADDRNOTAVAIL) memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr)); |