summaryrefslogtreecommitdiff
path: root/src/linux
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-05-09 18:52:28 +0000
committerChristian Pointner <equinox@anytun.org>2008-05-09 18:52:28 +0000
commit31c330838aaa247fd7b156b020df2ce95858f8e1 (patch)
tree59fb30ae7a5e090ddba3f1b8f77213df97ad8b6b /src/linux
parentlinux tun/tap device works now with tun *and* tap (diff)
small cleanup
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/tunDevice.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp
index 24bad02..446df4f 100644
--- a/src/linux/tunDevice.cpp
+++ b/src/linux/tunDevice.cpp
@@ -117,10 +117,10 @@ int TunDevice::write(u_int8_t* buf, u_int32_t len)
struct iphdr *hdr = reinterpret_cast<struct iphdr *>(buf);
tpi.flags = 0;
- if(hdr->version == 6)
- tpi.proto = htons(ETH_P_IPV6);
- else
+ if(hdr->version == 4)
tpi.proto = htons(ETH_P_IP);
+ else
+ tpi.proto = htons(ETH_P_IPV6);
iov[0].iov_base = &tpi;
iov[0].iov_len = sizeof(tpi);