- /* 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;
- strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
- interface = ifrname;
- }
- else
- if (!ioctl(device_fd, (('T'<< 8) | 202), (void *) &ifr))
- {
- syslog(LOG_WARNING, _("Old ioctl() request was needed for %s"), device);
- device_type = DEVICE_TYPE_TUNTAP;
- device_info = _("Linux tun/tap device");
- strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
- interface = ifrname;
- }
- else
+ /* Ok now check if this is an old ethertap or a new tun/tap thingie */
+
+ memset(&ifr, 0, sizeof(ifr));
+ ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+
+ if(interface)
+ strncpy(ifr.ifr_name, interface, IFNAMSIZ);
+
+ if(!ioctl(device_fd, TUNSETIFF, (void *) &ifr)) {
+ device_info = _("Linux tun/tap device");
+ device_type = DEVICE_TYPE_TUNTAP;
+ strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
+ interface = ifrname;
+ } else if(!ioctl(device_fd, (('T' << 8) | 202), (void *) &ifr)) {
+ syslog(LOG_WARNING, _("Old ioctl() request was needed for %s"), device);
+ device_type = DEVICE_TYPE_TUNTAP;
+ device_info = _("Linux tun/tap device");
+ strncpy(ifrname, ifr.ifr_name, IFNAMSIZ);
+ interface = ifrname;
+ } else