- if(device_fd < 0) {
- syslog(LOG_ERR, _("Could not open %s: %s"), device, strerror(errno));
- return -1;
- }
- cp
- /* Set default MAC address for ethertap devices */
- mymac.type = SUBNET_MAC;
- mymac.net.mac.address.x[0] = 0xfe;
- mymac.net.mac.address.x[1] = 0xfd;
- mymac.net.mac.address.x[2] = 0x00;
- mymac.net.mac.address.x[3] = 0x00;
- mymac.net.mac.address.x[4] = 0x00;
- mymac.net.mac.address.x[5] = 0x00;
-
-#ifdef HAVE_TUNTAP
- /* Ok now check if this is an old ethertap or a new tun/tap thingie */
-
- memset(&ifr, 0, sizeof(ifr));
- cp ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
- if(interface)
- strncpy(ifr.ifr_name, interface, IFNAMSIZ);
- cp if(!ioctl(device_fd, TUNSETIFF, (void *) &ifr)) {
- device_info = _("Linux tun/tap device");
- device_type = DEVICE_TYPE_TUNTAP;
+ if(iface)
+ strncpy(ifr.ifr_name, iface, IFNAMSIZ);
+
+ if(!ioctl(device_fd, TUNSETIFF, &ifr)) {