reverse addrv4 packing in s1ap

master
Francisco Paisana 5 years ago
parent a740fcb954
commit b1c5bf7185

@ -993,7 +993,10 @@ bool s1ap::send_initial_ctxt_setup_response(uint16_t rnti, const asn1::s1ap::ini
item.transport_layer_address.resize(32);
uint8_t addr[4];
inet_pton(AF_INET, args.gtp_bind_addr.c_str(), addr);
memcpy(item.transport_layer_address.data(), addr, 4);
for (uint32_t j = 0; j < 4; ++j) {
item.transport_layer_address.data()[j] = addr[3 - j];
}
// memcpy(item.transport_layer_address.data(), addr, 4);
}
return sctp_send_s1ap_pdu(tx_pdu, rnti, "InitialContextSetupResponse");
@ -1018,7 +1021,10 @@ bool s1ap::send_erab_setup_response(uint16_t rnti, const e_rab_setup_resp_s& res
item.transport_layer_address.resize(32);
uint8_t addr[4];
inet_pton(AF_INET, args.gtp_bind_addr.c_str(), addr);
memcpy(item.transport_layer_address.data(), addr, 4);
for (uint32_t j = 0; j < 4; ++j) {
item.transport_layer_address.data()[j] = addr[3 - j];
}
// memcpy(item.transport_layer_address.data(), addr, 4);
}
}

Loading…
Cancel
Save