summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-06-22 11:32:45 +0000
committerbrian <brian@cvs.openbsd.org>1999-06-22 11:32:45 +0000
commit3be9685d87a4bc46f2453a127186f92cd8590d76 (patch)
treee50d43fe8bb240eae64b85935f35c2c4280569c8 /usr.sbin
parentac5ca67a3d0453db348849ba987d21b19fd1c951 (diff)
Disable TUNSLMODE when we first open the tun device (FreeBSD only).
Submitted by: Ian West <ian@niw.com.au>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/bundle.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/bundle.c b/usr.sbin/ppp/ppp/bundle.c
index b7a19a598f3..29aefb0739b 100644
--- a/usr.sbin/ppp/ppp/bundle.c
+++ b/usr.sbin/ppp/ppp/bundle.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bundle.c,v 1.19 1999/06/02 00:46:55 brian Exp $
+ * $Id: bundle.c,v 1.20 1999/06/22 11:32:44 brian Exp $
*/
#include <sys/param.h>
@@ -722,7 +722,7 @@ bundle_Create(const char *prefix, int type, const char **argv)
static struct bundle bundle; /* there can be only one */
int enoentcount, err;
const char *ifname;
-#ifdef TUNSIFMODE
+#if defined(TUNSIFMODE) || defined(TUNSLMODE)
int iff;
#endif
@@ -780,6 +780,14 @@ bundle_Create(const char *prefix, int type, const char **argv)
strerror(errno));
#endif
+#ifdef TUNSLMODE
+ /* Make sure we're POINTOPOINT */
+ iff = 0;
+ if (ID0ioctl(bundle.dev.fd, TUNSLMODE, &iff) < 0)
+ log_Printf(LogERROR, "bundle_Create: ioctl(TUNSLMODE): %s\n",
+ strerror(errno));
+#endif
+
if (!iface_SetFlags(bundle.iface, IFF_UP)) {
iface_Destroy(bundle.iface);
bundle.iface = NULL;