浏览代码

Hack a hack because apple/BSD sockaddr length field was in the same position as the first byte of the mac address

Caleb James DeLisle 9 年之前
父节点
当前提交
71f05cb1bb
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      interface/ETHInterface.h

+ 5 - 1
interface/ETHInterface.h

@@ -48,8 +48,12 @@ Assert_compileTime(sizeof(struct ETHInterface_Header) == ETHInterface_Header_SIZ
 struct ETHInterface_Sockaddr
 {
     struct Sockaddr generic;
-    uint8_t mac[6];
+    /*
+     * We need to make the first byte following the Sockaddr be 0 because
+     * Sockaddr_normalizeNative will zero it.
+     */
     uint16_t zero;
+    uint8_t mac[6];
 };
 #define ETHInterface_Sockaddr_SIZE 16
 Assert_compileTime(sizeof(struct ETHInterface_Sockaddr) == ETHInterface_Sockaddr_SIZE);