Undo possible damage done by the new TUNSIFMODE ioctl

in FreeBSD-current.
This commit is contained in:
Brian Somers 1999-03-25 11:37:51 +00:00
parent 9939a2a908
commit 0f203c7e2e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45032

View File

@ -23,13 +23,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bundle.c,v 1.48 1999/03/04 17:42:14 brian Exp $
* $Id: bundle.c,v 1.49 1999/03/07 01:41:40 brian Exp $
*/
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#include <net/if_tun.h>
#include <arpa/inet.h>
#include <net/route.h>
#include <netinet/in_systm.h>
@ -739,6 +740,9 @@ bundle_Create(const char *prefix, int type, const char **argv)
const char *ifname;
struct ifreq ifrq;
static struct bundle bundle; /* there can be only one */
#ifdef TUNSIFMODE
int iff;
#endif
if (bundle.iface != NULL) { /* Already allocated ! */
log_Printf(LogALERT, "bundle_Create: There's only one BUNDLE !\n");
@ -794,6 +798,14 @@ bundle_Create(const char *prefix, int type, const char **argv)
return NULL;
}
#ifdef TUNSIFMODE
/* Make sure we're POINTOPOINT */
iff = IFF_POINTOPOINT;
if (ID0ioctl(bundle.dev.fd, TUNSIFMODE, &iff) < 0)
log_Printf(LogERROR, "bundle_Create: ioctl(TUNSIFMODE): %s\n",
strerror(errno));
#endif
/*
* Now, bring up the interface.
*/