summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pppd/sys-bsd.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-03-22 05:33:08 +0000
committerpeter <peter@FreeBSD.org>1998-03-22 05:33:08 +0000
commit485f592474900427073918c54f598c8260bba25d (patch)
treeddd0042aa4a673594cff43c0c4610d35d95cc316 /usr.sbin/pppd/sys-bsd.c
parente8b6792d29b46bb961a633ba7d8c7a7192506db2 (diff)
downloadFreeBSD-src-485f592474900427073918c54f598c8260bba25d.zip
FreeBSD-src-485f592474900427073918c54f598c8260bba25d.tar.gz
Merge ppp-2.3.3 changes onto mainline
Diffstat (limited to 'usr.sbin/pppd/sys-bsd.c')
-rw-r--r--usr.sbin/pppd/sys-bsd.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/usr.sbin/pppd/sys-bsd.c b/usr.sbin/pppd/sys-bsd.c
index 53b8e75..2838bc3 100644
--- a/usr.sbin/pppd/sys-bsd.c
+++ b/usr.sbin/pppd/sys-bsd.c
@@ -21,8 +21,9 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: sys-bsd.c,v 1.11 1997/08/19 17:52:47 peter Exp $";
+static char rcsid[] = "$Id: sys-bsd.c,v 1.12 1998/01/16 17:38:53 bde Exp $";
#endif
+/* $NetBSD: sys-bsd.c,v 1.1.1.3 1997/09/26 18:53:04 christos Exp $ */
/*
* TODO:
@@ -62,8 +63,17 @@ static char rcsid[] = "$Id: sys-bsd.c,v 1.11 1997/08/19 17:52:47 peter Exp $";
#endif
#if RTM_VERSION >= 3
+#include <sys/param.h>
+#if defined(NetBSD)
+#if (NetBSD >= 199703)
+#include <netinet/if_inarp.h>
+#else /* NetBSD 1.2D or later */
+#include <net/if_ether.h>
+#endif
+#else
#include <netinet/if_ether.h>
#endif
+#endif
#include "pppd.h"
#include "fsm.h"
@@ -950,6 +960,7 @@ sifaddr(u, o, h, m)
u_int32_t o, h, m;
{
struct ifaliasreq ifra;
+ struct ifreq ifr;
strncpy(ifra.ifra_name, ifname, sizeof(ifra.ifra_name));
SET_SA_FAMILY(ifra.ifra_addr, AF_INET);
@@ -961,6 +972,12 @@ sifaddr(u, o, h, m)
((struct sockaddr_in *) &ifra.ifra_mask)->sin_addr.s_addr = m;
} else
BZERO(&ifra.ifra_mask, sizeof(ifra.ifra_mask));
+ BZERO(&ifr, sizeof(ifr));
+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(sockfd, SIOCDIFADDR, (caddr_t) &ifr) < 0) {
+ if (errno != EADDRNOTAVAIL)
+ syslog(LOG_WARNING, "Couldn't remove interface address: %m");
+ }
if (ioctl(sockfd, SIOCAIFADDR, (caddr_t) &ifra) < 0) {
if (errno != EEXIST) {
syslog(LOG_ERR, "Couldn't set interface address: %m");
OpenPOWER on IntegriCloud