fix infini-ARP bug when pinging broadcast/network address
This commit is contained in:
@@ -138,6 +138,16 @@ class ARP(Service):
|
|||||||
target_ip_address
|
target_ip_address
|
||||||
)
|
)
|
||||||
if outbound_network_interface:
|
if outbound_network_interface:
|
||||||
|
# ensure we are not attempting to find the network address or broadcast address (not useable IPs)
|
||||||
|
intf_network_address = outbound_network_interface.ip_network.network_address
|
||||||
|
intf_broadcast_address = outbound_network_interface.ip_network.broadcast_address
|
||||||
|
if target_ip_address == intf_network_address:
|
||||||
|
self.sys_log.info(f"Cannot send ARP request to a network address {str(target_ip_address)}")
|
||||||
|
return
|
||||||
|
if target_ip_address == intf_broadcast_address:
|
||||||
|
self.sys_log.info(f"Cannot send ARP request to a broadcast addresss {str(target_ip_address)}")
|
||||||
|
return
|
||||||
|
|
||||||
self.sys_log.info(f"Sending ARP request from NIC {outbound_network_interface} for ip {target_ip_address}")
|
self.sys_log.info(f"Sending ARP request from NIC {outbound_network_interface} for ip {target_ip_address}")
|
||||||
arp_packet = ARPPacket(
|
arp_packet = ARPPacket(
|
||||||
sender_ip_address=outbound_network_interface.ip_address,
|
sender_ip_address=outbound_network_interface.ip_address,
|
||||||
|
|||||||
Reference in New Issue
Block a user