1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 13:04:28 +01:00

Fix serialization for QinQ (#316)

* Add QinQ Frame

* Fix serialization for QinQ
This commit is contained in:
Teodoro Vargas
2018-10-09 15:02:01 -06:00
committed by Matias Fontanini
parent c26e4943c2
commit 57ac099703
6 changed files with 27 additions and 10 deletions

View File

@@ -107,15 +107,10 @@ uint32_t Dot1Q::trailer_size() const {
void Dot1Q::write_serialization(uint8_t* buffer, uint32_t total_sz) {
OutputMemoryStream stream(buffer, total_sz);
if (inner_pdu()) {
Constants::Ethernet::e flag;
Constants::Ethernet::e flag = Constants::Ethernet::UNKNOWN;
PDUType type = inner_pdu()->pdu_type();
if (type == PDU::DOT1Q) {
flag = Constants::Ethernet::QINQ;
}
else {
// Set the appropriate payload type flag
flag = Internals::pdu_flag_to_ether_type(type);
}
// Set the appropriate payload type flag
flag = Internals::pdu_flag_to_ether_type(type);
if (flag != Constants::Ethernet::UNKNOWN) {
payload_type(static_cast<uint16_t>(flag));
}