mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Dot3::matches_response now works as expected.
This commit is contained in:
@@ -118,9 +118,11 @@ void Dot3::send(PacketSender &sender) {
|
||||
bool Dot3::matches_response(uint8_t *ptr, uint32_t total_sz) {
|
||||
if(total_sz < sizeof(ethhdr))
|
||||
return false;
|
||||
ethhdr *eth_ptr = (ethhdr*)ptr;
|
||||
const ethhdr *eth_ptr = (const ethhdr*)ptr;
|
||||
if(!memcmp(eth_ptr->dst_mac, _eth.src_mac, sizeof(_eth.src_mac))) {
|
||||
return true;
|
||||
ptr += sizeof(ethhdr);
|
||||
total_sz -= sizeof(ethhdr);
|
||||
return inner_pdu() ? inner_pdu()->matches_response(ptr, total_sz) : true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void EthernetII::send(PacketSender &sender) {
|
||||
bool EthernetII::matches_response(uint8_t *ptr, uint32_t total_sz) {
|
||||
if(total_sz < sizeof(ethhdr))
|
||||
return false;
|
||||
ethhdr *eth_ptr = (ethhdr*)ptr;
|
||||
const ethhdr *eth_ptr = (const ethhdr*)ptr;
|
||||
if(!memcmp(eth_ptr->dst_mac, _eth.src_mac, address_type::address_size)) {
|
||||
// chequear broadcast en destino original...
|
||||
return (inner_pdu()) ? inner_pdu()->matches_response(ptr + sizeof(_eth), total_sz - sizeof(_eth)) : true;
|
||||
|
||||
Reference in New Issue
Block a user