Patch up write_data() code.
Add write_datagram().
Fix packet size printout in missed().