mirror of
https://github.com/mfontanini/libtins
synced 2026-01-26 03:51:35 +01:00
Added malformed_packet exception. Every class except Dot11* use it.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "rawpdu.h"
|
||||
#include "constants.h"
|
||||
#include "network_interface.h"
|
||||
#include "exceptions.h"
|
||||
|
||||
|
||||
using std::runtime_error;
|
||||
@@ -59,7 +60,7 @@ ARP::ARP(ipaddress_type target_ip, ipaddress_type sender_ip,
|
||||
ARP::ARP(const uint8_t *buffer, uint32_t total_sz)
|
||||
{
|
||||
if(total_sz < sizeof(arphdr))
|
||||
throw runtime_error("Not enough size for an ARP header in the buffer.");
|
||||
throw malformed_packet();
|
||||
memcpy(&_arp, buffer, sizeof(arphdr));
|
||||
total_sz -= sizeof(arphdr);
|
||||
if(total_sz)
|
||||
|
||||
Reference in New Issue
Block a user