projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7e86cf9
)
Explicitly log which type of tunnel device is used.
author
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 24 Jul 2001 20:14:30 +0000
(20:14 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 24 Jul 2001 20:14:30 +0000
(20:14 +0000)
src/net.c
patch
|
blob
|
history
diff --git
a/src/net.c
b/src/net.c
index
8352ac5
..
7403a42
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.c,v 1.35.4.12
6 2001/07/21 20:21:25
guus Exp $
+ $Id: net.c,v 1.35.4.12
7 2001/07/24 20:14:30
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-204,7
+204,7
@@
cp
#ifdef HAVE_SOLARIS
if(write(tap_fd, packet->data + 14, packet->len - 14) < 0)
#ifdef HAVE_SOLARIS
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
total_tap_out += packet->len;
#else
else
total_tap_out += packet->len;
#else
@@
-360,7
+360,6
@@
cp
mymac.net.mac.address.x[5] = 0x00;
#ifdef HAVE_LINUX
mymac.net.mac.address.x[5] = 0x00;
#ifdef HAVE_LINUX
- taptype = TAP_TYPE_ETHERTAP;
#ifdef HAVE_TUNTAP
/* Ok now check if this is an old ethertap or a new tun/tap thingie */
memset(&ifr, 0, sizeof(ifr));
#ifdef HAVE_TUNTAP
/* Ok now check if this is an old ethertap or a new tun/tap thingie */
memset(&ifr, 0, sizeof(ifr));
@@
-371,12
+370,18
@@
cp
cp
if (!ioctl(tap_fd, TUNSETIFF, (void *) &ifr))
{
cp
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
#ifdef HAVE_FREEBSD
#endif
#ifdef HAVE_FREEBSD
+ syslog(LOG_INFO, _("%s is a tun/tap device"), tapfname);
taptype = TAP_TYPE_TUNTAP;
#endif
#ifdef HAVE_SOLARIS
taptype = TAP_TYPE_TUNTAP;
#endif
#ifdef HAVE_SOLARIS
@@
-412,10
+417,13
@@
cp
syslog(LOG_ERR, _("Can't set PPA %d: %m"), ppa);
return -1;
}
syslog(LOG_ERR, _("Can't set PPA %d: %m"), ppa);
return -1;
}
+
if(ioctl(ip_fd, I_LINK, if_fd) < 0){
syslog(LOG_ERR, _("Can't link TUN device to IP: %m"));
return -1;
}
if(ioctl(ip_fd, I_LINK, if_fd) < 0){
syslog(LOG_ERR, _("Can't link TUN device to IP: %m"));
return -1;
}
+
+ syslog(LOG_INFO, _("%s is a tun/tap device"), tapfname);
#endif
cp
#endif
cp