diff --git a/tests/test_nat_engine.c b/tests/test_nat_engine.c index 1015f941..b51b342f 100644 --- a/tests/test_nat_engine.c +++ b/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) {