فهرست منبع

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);