Only respond to ARPs requesting the external IP address.
This commit is contained in:
parent
d99cdfe521
commit
a2db8e751c
@ -140,7 +140,8 @@ eth_ARPmaker::ishandler(const eth_packet& outpacket) {
|
||||
(!memcmp(outpacket.buf+12, ethtype_arp, 2)) &&
|
||||
(outpacket.len<PACKET_BUF_SIZE) &&
|
||||
( (!memcmp(outpacket.buf, external_mac, 6))
|
||||
|| (!memcmp(outpacket.buf, broadcast_mac, 6)) )
|
||||
|| (!memcmp(outpacket.buf, broadcast_mac, 6)) ) &&
|
||||
(!memcmp(outpacket.buf+38, external_ip, 4))
|
||||
) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ static const Bit8u external_ip[]={ 192, 168, 0, 2, 0x00 };
|
||||
static const Bit8u broadcast_mac[]={0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00};
|
||||
static const Bit8u ethtype_arp[]={0x08, 0x06, 0x00};
|
||||
static const Bit8u ethtype_ip[]={0x08, 0x00, 0x00};
|
||||
static const Bit8u prot_udp=17;
|
||||
static const Bit8u prot_tcp=6;
|
||||
|
||||
|
||||
class eth_packet {
|
||||
|
Loading…
Reference in New Issue
Block a user