summaryrefslogtreecommitdiff
path: root/src/linux/tunDevice.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-05-12 21:30:22 +0000
committerChristian Pointner <equinox@anytun.org>2008-05-12 21:30:22 +0000
commitc38f0e21deb427802f4be2d4994903ae906ebbf2 (patch)
tree5d210c575fa40d58d4009b191c9ed68cb210efbc /src/linux/tunDevice.cpp
parentadded do_ifconfig for bsd device (diff)
fixed build on linux
Diffstat (limited to 'src/linux/tunDevice.cpp')
-rw-r--r--src/linux/tunDevice.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp
index 1882a93..a226641 100644
--- a/src/linux/tunDevice.cpp
+++ b/src/linux/tunDevice.cpp
@@ -28,6 +28,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#define _XOPEN_SOURCE 600
+#include <string.h>
+#include <sstream>
+
#include <fcntl.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
@@ -38,8 +42,6 @@
#include <linux/if_tun.h>
#define DEFAULT_DEVICE "/dev/net/tun"
-#include <sstream>
-
#include "tunDevice.h"
#include "threadUtils.hpp"
@@ -51,8 +53,8 @@ TunDevice::TunDevice(const char* dev_name, const char* dev_type, const char* ifc
std::string msg("can't open device file (");
msg.append(DEFAULT_DEVICE);
msg.append("): ");
- char buf[NL_TEXTMAX];
- strerror_r(errno, buf, NL_TEXTMAX);
+ char buf[STERROR_TEXT_MAX];
+ strerror_r(errno, buf, STERROR_TEXT_MAX);
msg.append(buf);
throw std::runtime_error(msg);
}
@@ -80,8 +82,8 @@ TunDevice::TunDevice(const char* dev_name, const char* dev_type, const char* ifc
actual_name_ = ifr.ifr_name;
} else {
std::string msg("tun/tap device ioctl failed: ");
- char buf[NL_TEXTMAX];
- strerror_r(errno, buf, NL_TEXTMAX);
+ char buf[STERROR_TEXT_MAX];
+ strerror_r(errno, buf, STERROR_TEXT_MAX);
msg.append(buf);
throw std::runtime_error(msg);
}