Quellcode durchsuchen

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 vor 9 Jahren
Ursprung
Commit
71f05cb1bb
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  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);