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:
committed by
Matias Fontanini
parent
c26e4943c2
commit
57ac099703
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user