protected void send(DatagramPacket p) throws IOException {   final IPv4Address dstAddress = new IPv4Address(p.getAddress()); final IPv4Header ipHdr; ipHdr = new IPv4Header(getTos(), getTimeToLive(), IPPROTO_UDP, dstAddress, p.getLength() + UDP_HLEN); if (!getLocalAddress().isAnyLocalAddress() || (getDevice() != null)) { ipHdr.setSource(new IPv4Address(getLocalAddress())); } final UDPHeader udpHdr; final int srcPort = p.getPort(); udpHdr = new UDPHeader(srcPort, p.getPort(), p.getLength());  final SocketBuffer skbuf = new SocketBuffer(p.getData(), p.getOffset(), p.getLength()); skbuf.setDevice(getDevice()); protocol.send(ipHdr, udpHdr, skbuf); }
protected void send(DatagramPacket p) throws IOException {   final IPv4Address dstAddress = new IPv4Address(p.getAddress()); final IPv4Header ipHdr; ipHdr = new IPv4Header(getTos(), getTimeToLive(), IPPROTO_UDP, dstAddress, p.getLength() + UDP_HLEN); if (!getLocalAddress().isAnyLocalAddress() || (getDevice() != null)) { ipHdr.setSource(new IPv4Address(getLocalAddress())); } final UDPHeader udpHdr; final int srcPort = getLocalPort();  udpHdr = new UDPHeader(srcPort, p.getPort(), p.getLength());  final SocketBuffer skbuf = new SocketBuffer(p.getData(), p.getOffset(), p.getLength()); skbuf.setDevice(getDevice()); protocol.send(ipHdr, udpHdr, skbuf); }
	protected void send(DatagramPacket p) throws IOException {		//Syslog.debug("UDP-send: " + p);				final IPv4Address dstAddress = new IPv4Address(p.getAddress());		final IPv4Header ipHdr;		ipHdr = new IPv4Header(getTos(), getTimeToLive(), IPPROTO_UDP, dstAddress, p.getLength() + UDP_HLEN);		if (!getLocalAddress().isAnyLocalAddress() || (getDevice() != null)) {			ipHdr.setSource(new IPv4Address(getLocalAddress()));		}		final UDPHeader udpHdr;		final int srcPort = p.getPort(); // or getLocalPort???? TODO Fix srcPort issue		udpHdr = new UDPHeader(srcPort, p.getPort(), p.getLength());				final SocketBuffer skbuf = new SocketBuffer(p.getData(), p.getOffset(), p.getLength());		skbuf.setDevice(getDevice());				protocol.send(ipHdr, udpHdr, skbuf);	}