Przeglądaj źródła

IP4.h: hostmask() needs to use htonl()

An IPv4 address is bigendian...
H. Peter Anvin 1 rok temu
rodzic
commit
528c0fe2a8

+ 1 - 1
esp32/max80/IP4.h

@@ -17,7 +17,7 @@ private:
 	uint32_t l;
     };
     static constexpr uint32_t hostmask(unsigned int n) {
-	return n >= 32 ? 0 : ((uint32_t)1 << n)-1;
+	return n >= 32 ? 0 : htonl(((uint32_t)1 << n)-1);
     }
 public:
     constexpr IP4() : l{0} { }

BIN
esp32/output/max80.ino.bin


BIN
fpga/output/max80.fw


BIN
fpga/output/v1.fw


BIN
fpga/output/v2.fw