mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 10:45:57 +01:00
Added tins_cast as a replacement for dynamic_cast when using it on PDU classes.
This commit is contained in:
@@ -96,9 +96,9 @@ void Loopback::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU
|
||||
#ifdef TINS_DEBUG
|
||||
assert(total_sz >= sizeof(_family));
|
||||
#endif
|
||||
if(dynamic_cast<const Tins::IP*>(inner_pdu()))
|
||||
if(tins_cast<const Tins::IP*>(inner_pdu()))
|
||||
_family = PF_INET;
|
||||
else if(dynamic_cast<const Tins::LLC*>(inner_pdu()))
|
||||
else if(tins_cast<const Tins::LLC*>(inner_pdu()))
|
||||
_family = PF_LLC;
|
||||
*reinterpret_cast<uint32_t*>(buffer) = _family;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user