Added logic for handling ICMP and ARP packets