Buggy code:
public class Router extends Device { public static final byte ICMP_TIME_EXCEEDED_TYPE = 11 ; public static final byte ICMP_TIME_EXCEEDED_CODE = 0 ; public static final byte ICMP_NET_UNREACHABLE_TYPE = 3 ; public static final byte ICMP_NET_UNREACHABLE_CODE = 0 ; public static final byte ICMP_HOST_UNREACHABLE_TYPE = 3 ; public static final byte ICMP_HOST_UNREACHABLE_CODE = 1 ; public static final byte ICMP_PORT_UNREACHABLE_TYPE = 3 ; public static final byte ICMP_PORT_UNREACHABLE_CODE = 3 ; public static final byte ICMP_ECHO_REQUEST_TYPE = 8 ; public static final byte ICMP_ECHO_RESPONSE_TYPE = 0 ; public static final byte ICMP_ECHO_RESPONSE_CODE = 0 ; private static final byte BC = ( ( byte ) ( 255 ) ) ; public static final byte [ ] BROADCAST_MAC = new byte [ ] { Router . BC , Router . BC , Router . BC , Router . BC , Router . BC , Router . BC } ; public static final byte [ ] ZERO_MAC = new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 } ; private class ArpLookupChecker extends TimerTask { @ Override public void run ( ) { } } private static class WaitingPacket { public WaitingPacket ( Iface inIface , Ethernet ether , IPv4 ip ) { } public Iface inIface ; public Ethernet ether ; public IPv4 ip ; } private class ArpDelayedSend { int numAttempts = 0 ; List < Router . WaitingPacket > waitingPackets = new LinkedList < Router . WaitingPacket > ( ) ; int targetIP ; Iface outIface ; public ArpDelayedSend ( int targetIP , Iface outIface ) { } private synchronized void addPacket ( Iface inIface , Ethernet ether , IPv4 ip ) { } public synchronized boolean tryAgain ( ) { } private synchronized void dropAllPackets ( ) { } private synchronized void register ( ARP info ) { } } private RouteTable routeTable ; private ArpCache arpCache ; private Timer arpUpdater ; private Map < Integer , Router . ArpDelayedSend > delayedSends = new HashMap < > ( ) ; public Router ( String host , DumpFile logfile ) { } public RouteTable getRouteTable ( ) { } public void loadRouteTable ( String routeTableFile ) { } public void loadArpCache ( String arpCacheFile ) { } public void handlePacket ( Ethernet etherPacket , Iface inIface ) { } private void handleArpPacket ( Ethernet etherPacket , Iface inIface ) { } private void sendArpReply ( Ethernet sourceEther , ARP sourceArp , Iface inIface ) { } private void broadcastArpRequest ( Iface outIface , int ip ) { System . out . println ( "Sending<seq2seq4repair_space>ARP<seq2seq4repair_space>Request" ) ; Ethernet ether = new Ethernet ( ) ; ARP arp = new ARP ( ) ; ether . setPayload ( arp ) ; ether . setEtherType ( TYPE_ARP ) ; ether . setSourceMACAddress ( outIface . getMacAddress ( ) . toBytes ( ) ) ; ether . setDestinationMACAddress ( Router . BROADCAST_MAC ) ; arp . setHardwareType ( HW_TYPE_ETHERNET ) ; arp . setProtocolType ( PROTO_TYPE_IP ) ; arp . setHardwareAddressLength ( ( ( byte ) ( DATALAYER_ADDRESS_LENGTH ) ) ) ; arp . setProtocolAddressLength ( ( ( byte ) ( 4 ) ) ) ; <START_BUG> arp . setOpCode ( OP_REPLY ) ; <END_BUG> arp . setSenderHardwareAddress ( outIface . getMacAddress ( ) . toBytes ( ) ) ; arp . setSenderProtocolAddress ( outIface . getIpAddress ( ) ) ; arp . setTargetHardwareAddress ( Router . ZERO_MAC ) ; arp . setTargetProtocolAddress ( ip ) ; dumpBinary ( ether . serialize ( ) , "ARP<seq2seq4repair_space>" ) ; sendPacket ( ether , outIface ) ; } private void handleArpResponse ( ARP info ) { } private void updateArpStatus ( ) { } private void delayPacket ( Iface inIface , Ethernet etherPacket , IPv4 ipPacket , int nextHop , Iface outIface ) { } private void handleIpPacket ( Ethernet etherPacket , Iface inIface ) { } private void forwardIpPacket ( Ethernet etherPacket , Iface inIface ) { } private void sendICMPIPPacket ( Iface source , Ethernet etherSource , IPv4 ipSource , byte type , byte code ) { } private void sendEchoResponse ( Iface source , Ethernet etherSource , IPv4 ipSource , ICMP icmpSource ) { } private void sendICMPPacket ( Iface source , Ethernet etherSource , IPv4 ipSource , byte type , byte code , byte [ ] payload ) { } private void dumpBinary ( byte [ ] data , String name4 ) { } }

Fix:
arp . setOpCode ( OP_REQUEST ) ;