--- gvpe/src/device-linux.C 2005/03/18 01:53:05 1.10 +++ gvpe/src/device-linux.C 2005/04/08 16:48:16 1.15 @@ -42,6 +42,8 @@ #endif #define DEFAULT_DEVICE "/dev/net/tun" +#include "gettext.h" + #include "conf.h" #if TEST_ETHEREMU @@ -55,6 +57,12 @@ return _("Linux tun/tap device"); } +const char * +tap_device::if_up () +{ + return "/sbin/ifconfig $IFNAME hw ether $MAC mtu $MTU"; +} + tap_device::tap_device () { struct ifreq ifr; @@ -88,10 +96,20 @@ } else { - slog (L_CRIT, _("unable to configure tun/tap interface: %s"), strerror (errno)); + slog (L_CRIT, _("unable to configure tun/tap interface, exiting: %s"), strerror (errno)); exit (EXIT_FAILURE); } +#if 0 + does not work + id2mac (THISNODE->id, &ifr.ifr_hwaddr.sa_data); + if (ioctl (fd, SIOCSIFHWADDR, &ifr)) + { + slog (L_ERR, _("cannot set MAC address for device %s, exiting: %s"), ifrname, strerror (errno)); + exit (EXIT_FAILURE); + } +#endif + if (ioctl (fd, TUNSETPERSIST, conf.ifpersist ? 1 : 0)) slog (L_WARN, _("cannot set persistency mode for device %s: %s"), ifrname, strerror (errno));