ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/device-linux.C
(Generate patch)

Comparing gvpe/src/device-linux.C (file contents):
Revision 1.12 by pcg, Wed Mar 23 21:55:39 2005 UTC vs.
Revision 1.15 by pcg, Fri Apr 8 16:48:16 2005 UTC

58} 58}
59 59
60const char * 60const char *
61tap_device::if_up () 61tap_device::if_up ()
62{ 62{
63 return "/sbin/ifconfig $IFNAME hw ether $MAC mtu $MTU up"; 63 return "/sbin/ifconfig $IFNAME hw ether $MAC mtu $MTU";
64} 64}
65 65
66tap_device::tap_device () 66tap_device::tap_device ()
67{ 67{
68 struct ifreq ifr; 68 struct ifreq ifr;
94 strncpy (ifrname, ifr.ifr_name, IFNAMSIZ); 94 strncpy (ifrname, ifr.ifr_name, IFNAMSIZ);
95 ifrname [IFNAMSIZ] = 0; 95 ifrname [IFNAMSIZ] = 0;
96 } 96 }
97 else 97 else
98 { 98 {
99 slog (L_CRIT, _("unable to configure tun/tap interface: %s"), strerror (errno)); 99 slog (L_CRIT, _("unable to configure tun/tap interface, exiting: %s"), strerror (errno));
100 exit (EXIT_FAILURE); 100 exit (EXIT_FAILURE);
101 } 101 }
102
103#if 0
104 does not work
105 id2mac (THISNODE->id, &ifr.ifr_hwaddr.sa_data);
106 if (ioctl (fd, SIOCSIFHWADDR, &ifr))
107 {
108 slog (L_ERR, _("cannot set MAC address for device %s, exiting: %s"), ifrname, strerror (errno));
109 exit (EXIT_FAILURE);
110 }
111#endif
102 112
103 if (ioctl (fd, TUNSETPERSIST, conf.ifpersist ? 1 : 0)) 113 if (ioctl (fd, TUNSETPERSIST, conf.ifpersist ? 1 : 0))
104 slog (L_WARN, _("cannot set persistency mode for device %s: %s"), ifrname, strerror (errno)); 114 slog (L_WARN, _("cannot set persistency mode for device %s: %s"), ifrname, strerror (errno));
105 115
106 slog (L_DEBUG, _("%s is a %s"), device, info ()); 116 slog (L_DEBUG, _("%s is a %s"), device, info ());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines