java – jpcap error sending packets cooked mode

Exception or error: I want to send a UDP packet using jpcap. My code is: PcapNetworkInterface nif = Pcaps.getDevByName(args[0]); int snapLen = 65536; PromiscuousMode mode = PromiscuousMode.NONPROMISCUOUS; int timeout = 10000; PcapHandle handle = nif.openLive(snapLen, mode, timeout); UdpPort srcPort = new UdpPort((short)1002,””); UdpPort dstPort = new UdpPort((short)2001, “”);; short length = (short)12; short checksum = …