Browse Source

Fix: Split multi-var init and rename s_net/d_net to src_net/dst_net to avoid MSYS2 S_un macro conflict

congestion
Evgeny 5 months ago
parent
commit
2fadec947b
  1. 7
      tests/test_nat_engine.c

7
tests/test_nat_engine.c

@ -48,9 +48,10 @@ static void build_ip_hdr(uint8_t* buf, uint8_t proto, uint32_t src_host, uint32_
buf[8] = 64;
buf[9] = proto;
memset(buf + 10, 0, 2); // checksum slot = 0 for now
uint32_t s_net = htobe32(src_host), d_net = htobe32(dst_host);
memcpy(buf + 12, &s_net, 4);
memcpy(buf + 16, &d_net, 4);
uint32_t src_net = htobe32(src_host);
uint32_t dst_net = htobe32(dst_host);
memcpy(buf + 12, &src_net, 4);
memcpy(buf + 16, &dst_net, 4);
}
static void compute_ip_checksum(uint8_t* ip) {

Loading…
Cancel
Save