diff --git a/impl/test/layer2_over_udp/l2udptest_client.c b/impl/test/layer2_over_udp/l2udptest_client.c index 5937004..456e82a 100644 --- a/impl/test/layer2_over_udp/l2udptest_client.c +++ b/impl/test/layer2_over_udp/l2udptest_client.c @@ -104,10 +104,10 @@ void rx_data_to_tun(const layer2_data_packet_t *data_packet) switch(data_packet->payload_type) { case L2_PAYLOAD_TYPE_IPV6: - *(uint16_t*)(tun_packet+2) = 0x86dd; + *(uint16_t*)(tun_packet+2) = htons(0x86dd); break; case L2_PAYLOAD_TYPE_IPV4: - *(uint16_t*)(tun_packet+2) = 0x0800; + *(uint16_t*)(tun_packet+2) = htons(0x0800); break; default: LOG(LVL_ERR, "Unsupported payload type: 0x%08x.", data_packet->payload_type); diff --git a/impl/test/layer2_over_udp/l2udptest_digipeater.c b/impl/test/layer2_over_udp/l2udptest_digipeater.c index 32ed7b2..20e5307 100644 --- a/impl/test/layer2_over_udp/l2udptest_digipeater.c +++ b/impl/test/layer2_over_udp/l2udptest_digipeater.c @@ -101,10 +101,10 @@ void rx_data_to_tun(const layer2_data_packet_t *data_packet) switch(data_packet->payload_type) { case L2_PAYLOAD_TYPE_IPV6: - *(uint16_t*)(tun_packet+2) = 0x86dd; + *(uint16_t*)(tun_packet+2) = htons(0x86dd); break; case L2_PAYLOAD_TYPE_IPV4: - *(uint16_t*)(tun_packet+2) = 0x0800; + *(uint16_t*)(tun_packet+2) = htons(0x0800); break; default: LOG(LVL_ERR, "Unsupported payload type: 0x%08x.", data_packet->payload_type);