Browse Source

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

An IPv4 address is bigendian...
H. Peter Anvin 1 year ago
parent
commit
528c0fe2a8
5 changed files with 1 additions and 1 deletions
  1. 1 1
      esp32/max80/IP4.h
  2. BIN
      esp32/output/max80.ino.bin
  3. BIN
      fpga/output/max80.fw
  4. BIN
      fpga/output/v1.fw
  5. BIN
      fpga/output/v2.fw

+ 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