Skip to content

[arp_responder] Possible improvement for the way of filter ARP packets #442

@keboliu

Description

@keboliu

In the current implementation of arp_responder, it captures all the packets and then filter the arp packets by the length of packets:

ETH_P_ALL = 0x03
...
self.socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(self.ETH_P_ALL))
...
if len(data) != self.ARP_PKT_LEN:

Why not capture ARP packets directly by defining a more accurate packet type? like:

ETH_P_ARP = 0x806
...
self.socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(self.ETH_P_ARP))

by this can make arp_responder more efficient and avoid to capture some other type of packets which also have the same length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions