Fix byte order in TUN packet header
This commit is contained in:
parent
b2df27bb92
commit
04399c0022
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue