Explicitly log which type of tunnel device is used.
This commit is contained in:
parent
7e86cf91e3
commit
30d22474cc
1 changed files with 12 additions and 4 deletions
16
src/net.c
16
src/net.c
|
@ -17,7 +17,7 @@
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id: net.c,v 1.35.4.126 2001/07/21 20:21:25 guus Exp $
|
$Id: net.c,v 1.35.4.127 2001/07/24 20:14:30 guus Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -204,7 +204,7 @@ cp
|
||||||
|
|
||||||
#ifdef HAVE_SOLARIS
|
#ifdef HAVE_SOLARIS
|
||||||
if(write(tap_fd, packet->data + 14, packet->len - 14) < 0)
|
if(write(tap_fd, packet->data + 14, packet->len - 14) < 0)
|
||||||
syslog(LOG_ERR, _("Can't write to tun device: %m"));
|
syslog(LOG_ERR, _("Can't write to tun/tap device: %m"));
|
||||||
else
|
else
|
||||||
total_tap_out += packet->len;
|
total_tap_out += packet->len;
|
||||||
#else
|
#else
|
||||||
|
@ -360,7 +360,6 @@ cp
|
||||||
mymac.net.mac.address.x[5] = 0x00;
|
mymac.net.mac.address.x[5] = 0x00;
|
||||||
|
|
||||||
#ifdef HAVE_LINUX
|
#ifdef HAVE_LINUX
|
||||||
taptype = TAP_TYPE_ETHERTAP;
|
|
||||||
#ifdef HAVE_TUNTAP
|
#ifdef HAVE_TUNTAP
|
||||||
/* Ok now check if this is an old ethertap or a new tun/tap thingie */
|
/* Ok now check if this is an old ethertap or a new tun/tap thingie */
|
||||||
memset(&ifr, 0, sizeof(ifr));
|
memset(&ifr, 0, sizeof(ifr));
|
||||||
|
@ -371,12 +370,18 @@ cp
|
||||||
cp
|
cp
|
||||||
if (!ioctl(tap_fd, TUNSETIFF, (void *) &ifr))
|
if (!ioctl(tap_fd, TUNSETIFF, (void *) &ifr))
|
||||||
{
|
{
|
||||||
syslog(LOG_INFO, _("%s is a new style tun/tap device"), tapfname);
|
syslog(LOG_INFO, _("%s is a tun/tap device"), tapfname);
|
||||||
taptype = TAP_TYPE_TUNTAP;
|
taptype = TAP_TYPE_TUNTAP;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
syslog(LOG_INFO, _("%s is an ethertap device"), tapfname);
|
||||||
|
taptype = TAP_TYPE_ETHERTAP;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_FREEBSD
|
#ifdef HAVE_FREEBSD
|
||||||
|
syslog(LOG_INFO, _("%s is a tun/tap device"), tapfname);
|
||||||
taptype = TAP_TYPE_TUNTAP;
|
taptype = TAP_TYPE_TUNTAP;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SOLARIS
|
#ifdef HAVE_SOLARIS
|
||||||
|
@ -412,10 +417,13 @@ cp
|
||||||
syslog(LOG_ERR, _("Can't set PPA %d: %m"), ppa);
|
syslog(LOG_ERR, _("Can't set PPA %d: %m"), ppa);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ioctl(ip_fd, I_LINK, if_fd) < 0){
|
if(ioctl(ip_fd, I_LINK, if_fd) < 0){
|
||||||
syslog(LOG_ERR, _("Can't link TUN device to IP: %m"));
|
syslog(LOG_ERR, _("Can't link TUN device to IP: %m"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syslog(LOG_INFO, _("%s is a tun/tap device"), tapfname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cp
|
cp
|
||||||
|
|
Loading…
Reference in a new issue