1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Serialize Loopback on Windows and use proper flag for IPv6

This commit is contained in:
Matias Fontanini
2017-08-13 10:46:36 -07:00
parent c84652af40
commit 78b94fa350

View File

@@ -94,15 +94,16 @@ uint32_t Loopback::header_size() const {
void Loopback::write_serialization(uint8_t* buffer, uint32_t total_sz) {
OutputMemoryStream stream(buffer, total_sz);
#ifndef _WIN32
if (tins_cast<const Tins::IP*>(inner_pdu())) {
family_ = PF_INET;
}
else if (tins_cast<const Tins::IPv6*>(inner_pdu())) {
family_ = PF_INET6;
}
else if (tins_cast<const Tins::LLC*>(inner_pdu())) {
family_ = PF_LLC;
}
stream.write(family_);
#endif // _WIN32
}
bool Loopback::matches_response(const uint8_t* ptr, uint32_t total_sz) const {