Disable TUNSLMODE when we first open the tun device.

Submitted by: Ian West <ian@niw.com.au>
This commit is contained in:
Brian Somers 1999-06-22 11:31:42 +00:00
parent 0622eafc89
commit 6ca65df0a7

View File

@ -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.55 1999/05/31 23:57:32 brian Exp $
* $Id: bundle.c,v 1.56 1999/06/02 00:46:50 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;