mirror of
https://github.com/mfontanini/libtins
synced 2026-01-27 12:14:26 +01:00
Implemented matches_response on several PDUs. Added some test cases.
This commit is contained in:
@@ -133,7 +133,8 @@ bool EthernetII::matches_response(uint8_t *ptr, uint32_t total_sz) {
|
||||
const size_t addr_sz = address_type::address_size;
|
||||
const ethhdr *eth_ptr = (const ethhdr*)ptr;
|
||||
if(std::equal(_eth.src_mac, _eth.src_mac + addr_sz, eth_ptr->dst_mac)) {
|
||||
if(std::equal(_eth.src_mac, _eth.src_mac + addr_sz, eth_ptr->dst_mac) || dst_addr() == BROADCAST)
|
||||
if(std::equal(_eth.src_mac, _eth.src_mac + addr_sz, eth_ptr->dst_mac) || dst_addr() == BROADCAST ||
|
||||
(_eth.src_mac[0] == 0x33 && _eth.src_mac[1] == 0x33))
|
||||
{
|
||||
return (inner_pdu()) ? inner_pdu()->matches_response(ptr + sizeof(_eth), total_sz - sizeof(_eth)) : true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user