along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.4 2002/09/10 21:29:42 guus Exp $
+ $Id: device.c,v 1.1.2.5 2003/06/11 19:28:36 guus Exp $
*/
#include "config.h"
int device_total_in = 0;
int device_total_out = 0;
-extern subnet_t mymac;
-
int setup_device(void)
{
struct ifreq ifr;
return -1;
}
- /* 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;
-
device_info = _("Stub device for Cygwin environment");
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.5 2002/09/10 21:29:42 guus Exp $
+ $Id: device.c,v 1.1.2.6 2003/06/11 19:28:36 guus Exp $
*/
#include "config.h"
int device_total_in = 0;
int device_total_out = 0;
-extern subnet_t mymac;
-
/*
open the local ethertap device
*/
return -1;
}
- /* 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;
-
device_info = _("MacOS/X tun device");
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
return -1;
}
- memcpy(packet->data, mymac.net.mac.address.x, 6);
- memcpy(packet->data + 6, mymac.net.mac.address.x, 6);
packet->data[12] = 0x08;
packet->data[13] = 0x00;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.8 2002/09/10 21:29:42 guus Exp $
+ $Id: device.c,v 1.1.2.9 2003/06/11 19:28:37 guus Exp $
*/
#include "config.h"
int device_total_in = 0;
int device_total_out = 0;
-extern subnet_t mymac;
-
/*
open the local ethertap device
*/
return -1;
}
- /* 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;
-
device_info = _("FreeBSD tap device");
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.14 2003/06/11 19:09:52 guus Exp $
+ $Id: device.c,v 1.1.2.15 2003/06/11 19:28:37 guus Exp $
*/
#include "config.h"
int device_total_in = 0;
int device_total_out = 0;
-extern subnet_t mymac;
-
/*
open the local ethertap device
*/
return -1;
}
- /* 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 */
} else
#endif
{
+ if(routing_mode == RMODE_ROUTER)
+ overwrite_mac = 1;
device_info = _("Linux ethertap device");
device_type = DEVICE_TYPE_ETHERTAP;
interface = rindex(device, '/') ? rindex(device, '/') + 1 : device;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.7 2002/09/10 21:29:42 guus Exp $
+ $Id: device.c,v 1.1.2.8 2003/06/11 19:28:37 guus Exp $
*/
#include "config.h"
int device_total_in = 0;
int device_total_out = 0;
-extern subnet_t mymac;
-
/*
open the local ethertap device
*/
return -1;
}
- /* 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;
-
device_info = _("NetBSD tun device");
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
return -1;
}
- memcpy(packet->data, mymac.net.mac.address.x, 6);
- memcpy(packet->data + 6, mymac.net.mac.address.x, 6);
packet->data[12] = 0x08;
packet->data[13] = 0x00;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.12 2002/09/10 21:29:42 guus Exp $
+ $Id: device.c,v 1.1.2.13 2003/06/11 19:28:37 guus Exp $
*/
#include "config.h"
int device_total_in = 0;
int device_total_out = 0;
-extern subnet_t mymac;
-
/*
open the local ethertap device
*/
return -1;
}
- /* 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;
-
device_info = _("OpenBSD tun device");
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
return -1;
}
- memcpy(packet->data, mymac.net.mac.address.x, 6);
- memcpy(packet->data + 6, mymac.net.mac.address.x, 6);
-
switch (ntohl(type)) {
case AF_INET:
packet->data[12] = 0x8;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.4 2002/09/10 21:29:42 guus Exp $
+ $Id: device.c,v 1.1.2.5 2003/06/11 19:28:38 guus Exp $
*/
#include "config.h"
int device_total_in = 0;
int device_total_out = 0;
-extern subnet_t mymac;
-
/*
open the local ethertap device
*/
return -1;
}
- /* 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;
-
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
return 0;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: route.c,v 1.1.2.49 2003/03/29 22:11:22 guus Exp $
+ $Id: route.c,v 1.1.2.50 2003/06/11 19:28:35 guus Exp $
*/
#include "config.h"
int routing_mode = RMODE_ROUTER;
int priorityinheritance = 0;
int macexpire = 600;
-subnet_t mymac;
+int overwrite_mac = 0;
+mac_t mymac = {0xFE, 0xFD, 0, 0, 0, 0};
/* RFC 1071 */
/* First, snatch the source address from the neighbor solicitation packet */
- memcpy(mymac.net.mac.address.x, packet->data + 6, 6);
+ if(overwrite_mac)
+ memcpy(mymac.x, packet->data + 6, 6);
/* Check if this is a valid neighbor solicitation request */
/* First, snatch the source address from the ARP packet */
- memcpy(mymac.net.mac.address.x, packet->data + 6, 6);
+ if(overwrite_mac)
+ memcpy(mymac.x, packet->data + 6, 6);
/* This routine generates replies to ARP requests.
You don't need to set NOARP flag on the interface anymore (which is broken on FreeBSD).
if(n) {
if(n == myself) {
- memcpy(packet->data, mymac.net.mac.address.x, 6);
+ if(overwrite_mac)
+ memcpy(packet->data, mymac.x, 6);
write_packet(packet);
} else
send_packet(n, packet);
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: route.h,v 1.1.2.9 2002/09/09 21:25:07 guus Exp $
+ $Id: route.h,v 1.1.2.10 2003/06/11 19:28:35 guus Exp $
*/
#ifndef __TINC_ROUTE_H__
};
extern int routing_mode;
+extern int overwrite_mac;
extern int priorityinheritance;
extern int macexpire;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.1.2.11 2002/09/10 21:29:42 guus Exp $
+ $Id: device.c,v 1.1.2.12 2003/06/11 19:28:38 guus Exp $
*/
int device_total_in = 0;
int device_total_out = 0;
-subnet_t mymac;
-
int setup_device(void)
{
int ip_fd = -1, if_fd = -1;
device_info = _("Solaris tun device");
- /* 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;
-
syslog(LOG_INFO, _("%s is a %s"), device, device_info);
return 0;
return -1;
}
- memcpy(packet->data, mymac.net.mac.address.x, 6);
- memcpy(packet->data + 6, mymac.net.mac.address.x, 6);
packet->data[12] = 0x08;
packet->data[13] = 0x00;