mirror of
https://github.com/mfontanini/libtins
synced 2026-01-24 03:05:57 +01:00
Added malformed_packet exception. Every class except Dot11* use it.
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "ip.h"
|
||||
#include "llc.h"
|
||||
#include "rawpdu.h"
|
||||
#include "exceptions.h"
|
||||
|
||||
#if !defined(PF_LLC)
|
||||
// compilation fix, nasty but at least works on BSD
|
||||
@@ -65,7 +66,7 @@ Loopback::Loopback(const NetworkInterface &iface, PDU *inner_pdu)
|
||||
Loopback::Loopback(const uint8_t *buffer, uint32_t total_sz)
|
||||
{
|
||||
if(total_sz < sizeof(_family))
|
||||
throw std::runtime_error("Not enough size for a loopback PDU");
|
||||
throw malformed_packet();
|
||||
_family = *reinterpret_cast<const uint32_t*>(buffer);
|
||||
buffer += sizeof(uint32_t);
|
||||
total_sz -= sizeof(uint32_t);
|
||||
|
||||
Reference in New Issue
Block a user