1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 12:14:26 +01:00

STP is now serialized correctly. LLC behaves correctly when it contains an STP is its inner pdu.

This commit is contained in:
Matias Fontanini
2013-04-16 01:05:06 -03:00
parent 9631734805
commit 38ccb4413b
5 changed files with 51 additions and 8 deletions

View File

@@ -28,6 +28,7 @@
*/
#include <cstring>
#include <cassert>
#include "stp.h"
namespace Tins {
@@ -86,7 +87,10 @@ void STP::fwd_delay(uint16_t new_fwd_delay) {
}
void STP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *) {
#ifdef TINS_DEBUG
assert(total_sz >= sizeof(_header));
#endif
std::memcpy(buffer, &_header, sizeof(_header));
}
uint32_t STP::header_size() const {