Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
71f05cb1bb
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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);