summaryrefslogtreecommitdiff
path: root/usr.sbin/pppd/sys-bsd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 23:47:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 23:47:39 +0000
commit882e83ccf31fca22178b290a6753a605bb52044c (patch)
treee2e6ec6ef7e162fd03a03e5c71bc96ce90d1c105 /usr.sbin/pppd/sys-bsd.c
parent67d88b0a9910a68bb666b448d2dac29cb4d3d8c2 (diff)
sync to netbsd 960418
Diffstat (limited to 'usr.sbin/pppd/sys-bsd.c')
-rw-r--r--usr.sbin/pppd/sys-bsd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/pppd/sys-bsd.c b/usr.sbin/pppd/sys-bsd.c
index d4912257164..d8891d71f41 100644
--- a/usr.sbin/pppd/sys-bsd.c
+++ b/usr.sbin/pppd/sys-bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys-bsd.c,v 1.2 1996/03/25 15:55:57 niklas Exp $ */
+/* $OpenBSD: sys-bsd.c,v 1.3 1996/04/21 23:41:29 deraadt Exp $ */
/*
* sys-bsd.c - System-dependent procedures for setting up
@@ -23,7 +23,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: sys-bsd.c,v 1.2 1996/03/25 15:55:57 niklas Exp $";
+static char rcsid[] = "$OpenBSD: sys-bsd.c,v 1.3 1996/04/21 23:41:29 deraadt Exp $";
#endif
/*
@@ -78,6 +78,7 @@ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
static int sockfd; /* socket for doing interface ioctls */
static int if_is_up; /* the interface is currently up */
+static u_int32_t ifaddrs[2]; /* local and remote addresses we set */
static u_int32_t default_route_gateway; /* gateway addr for default route */
static u_int32_t proxy_arp_addr; /* remote addr for proxy arp */
@@ -122,7 +123,8 @@ sys_cleanup()
ioctl(sockfd, SIOCSIFFLAGS, &ifr);
}
}
-
+ if (ifaddrs[0] != 0)
+ cifaddr(0, ifaddrs[0], ifaddrs[1]);
if (default_route_gateway)
cifdefaultroute(0, default_route_gateway);
if (proxy_arp_addr)
@@ -983,6 +985,8 @@ sifaddr(u, o, h, m)
syslog(LOG_WARNING,
"Couldn't set interface address: Address already exists");
}
+ ifaddrs[0] = o;
+ ifaddrs[1] = h;
return 1;
}
@@ -997,6 +1001,7 @@ cifaddr(u, o, h)
{
struct ifaliasreq ifra;
+ ifaddrs[0] = 0;
strncpy(ifra.ifra_name, ifname, sizeof(ifra.ifra_name));
SET_SA_FAMILY(ifra.ifra_addr, AF_INET);
((struct sockaddr_in *) &ifra.ifra_addr)->sin_addr.s_addr = o;