1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-25 19:51:34 +01:00

Marked PDU::clone_packet as deprecated.

This commit is contained in:
Matias Fontanini
2013-03-24 16:08:09 -03:00
parent d7dd1e131f
commit 8be0c4c23c
16 changed files with 90 additions and 67 deletions

View File

@@ -119,17 +119,7 @@ bool ARP::matches_response(uint8_t *ptr, uint32_t total_sz) {
}
PDU *ARP::clone_packet(const uint8_t *ptr, uint32_t total_sz) {
if(total_sz < sizeof(arphdr))
return 0;
PDU *child = 0, *cloned;
if(total_sz > sizeof(arphdr)) {
child = PDU::clone_inner_pdu(ptr + sizeof(arphdr), total_sz - sizeof(arphdr));
if(!child)
return 0;
}
cloned = new ARP(ptr, std::min(total_sz, (uint32_t)sizeof(_arp)));
cloned->inner_pdu(child);
return cloned;
return new ARP(ptr, total_sz);
}
EthernetII ARP::make_arp_request(const NetworkInterface& iface,