summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-23 16:10:24 -0800
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-23 16:10:24 -0800
commit87714181701fa92016c37937f786bbf5434ef182 (patch)
tree7fe6f11b838b381cb5ea8977de1e0369b281dca2 /node
parent2f37ea842fc15790406d770a487725e70c1aa98c (diff)
downloadinfinitytier-87714181701fa92016c37937f786bbf5434ef182.tar.gz
infinitytier-87714181701fa92016c37937f786bbf5434ef182.zip
Fix bug in tap driver introduced during unused code purge (deleted the part that acknowledges writes!), and fix bug in EthernetTap causing 0000 for etherType. Windows works now! Yay!
Diffstat (limited to 'node')
-rw-r--r--node/EthernetTap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/node/EthernetTap.cpp b/node/EthernetTap.cpp
index 47355cbc..81cf5c4f 100644
--- a/node/EthernetTap.cpp
+++ b/node/EthernetTap.cpp
@@ -1385,7 +1385,8 @@ void EthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const
char *d = _injectPending.back().first.data;
memcpy(d,to.data,6);
memcpy(d + 6,from.data,6);
- *((uint16_t *)(d + 12)) = Utils::hton(etherType);
+ d[12] = (char)((etherType >> 8) & 0xff);
+ d[13] = (char)(etherType & 0xff);
memcpy(d + 14,data,len);
}
@@ -1475,7 +1476,6 @@ void EthernetTap::threadMain()
MAC from(_tapReadBuf + 6);
unsigned int etherType = Utils::ntoh(*((const uint16_t *)(_tapReadBuf + 12)));
Buffer<4096> tmp(_tapReadBuf + 14,bytesRead - 14);
- //printf("GOT FRAME: %u bytes: %s\r\n",(unsigned int)bytesRead,Utils::hex(_tapReadBuf,bytesRead).c_str());
_handler(_arg,from,to,etherType,tmp);
}
}