Handle TFTP ERROR from client

If a PXE client only wants to find out the size of a file, it will
open the file and then abort the transfer by sending a TFTP ERROR packet.

The ERROR packet should cause qemu to terminate the session. If not,
the sessions will soon run out and cause timeouts in the client.

Also, if a TFTP session already exists with same IP/UDP port, it
should be terminated when a new RRQ is received, instead of creating a
duplicate (which will never be used).

A patch for gPXE to send the ERROR packet is also being submitted to
gPXE. Together they resolve slowness/hanging when booting pxegrub from
qemu's internal TFTP server. The patch from Milan Plzik to return
after sending OACK is also required for a complete fix.

Signed-off-by: Thomas Horsten <thomas@horsten.com>
Signed-off-by: Milan Plzik <milan.plzik@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
1 file changed
tree: a6af1f4e0f8c87e9ed86f43eb93141439d145fb8
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. default-configs/
  6. fpu/
  7. gdb-xml/
  8. hw/
  9. linux-user/
  10. net/
  11. pc-bios/
  12. QMP/
  13. roms/
  14. slirp/
  15. target-alpha/
  16. target-arm/
  17. target-cris/
  18. target-i386/
  19. target-m68k/
  20. target-microblaze/
  21. target-mips/
  22. target-ppc/
  23. target-s390x/
  24. target-sh4/
  25. target-sparc/
  26. tcg/
  27. tests/
  28. .gitignore
  29. .gitmodules
  30. a.out.h
  31. acl.c
  32. acl.h
  33. aes.c
  34. aes.h
  35. aio.c
  36. alpha-dis.c
  37. alpha.ld
  38. arm-dis.c
  39. arm-semi.c
  40. arm.ld
  41. async.c
  42. balloon.h
  43. block-migration.c
  44. block-migration.h
  45. block.c
  46. block.h
  47. block_int.h
  48. bswap.h
  49. bt-host.c
  50. bt-host.h
  51. bt-vhci.c
  52. buffered_file.c
  53. buffered_file.h
  54. cache-utils.c
  55. cache-utils.h
  56. Changelog
  57. check-qdict.c
  58. check-qfloat.c
  59. check-qint.c
  60. check-qjson.c
  61. check-qlist.c
  62. check-qstring.c
  63. cmd.c
  64. cmd.h
  65. cocoa.m
  66. CODING_STYLE
  67. config.h
  68. configure
  69. console.c
  70. console.h
  71. COPYING
  72. COPYING.LIB
  73. cpu-all.h
  74. cpu-common.h
  75. cpu-defs.h
  76. cpu-exec.c
  77. create_config
  78. cris-dis.c
  79. curses.c
  80. curses_keys.h
  81. cutils.c
  82. d3des.c
  83. d3des.h
  84. def-helper.h
  85. device_tree.c
  86. device_tree.h
  87. dis-asm.h
  88. disas.c
  89. disas.h
  90. dma-helpers.c
  91. dma.h
  92. dyngen-exec.h
  93. elf.h
  94. envlist.c
  95. envlist.h
  96. exec-all.h
  97. exec.c
  98. feature_to_c.sh
  99. gdbstub.c
  100. gdbstub.h
  101. gen-icount.h
  102. host-utils.c
  103. host-utils.h
  104. hostregs_helper.h
  105. hpet.h
  106. hppa-dis.c
  107. hppa.ld
  108. hxtool
  109. i386-dis.c
  110. i386.ld
  111. ia64.ld
  112. ioport-user.c
  113. ioport.c
  114. ioport.h
  115. json-lexer.c
  116. json-lexer.h
  117. json-parser.c
  118. json-parser.h
  119. json-streamer.c
  120. json-streamer.h
  121. keymaps.c
  122. keymaps.h
  123. kvm-all.c
  124. kvm.h
  125. libfdt_env.h
  126. LICENSE
  127. linux-aio.c
  128. m68k-dis.c
  129. m68k-semi.c
  130. m68k.ld
  131. MAINTAINERS
  132. Makefile
  133. Makefile.hw
  134. Makefile.objs
  135. Makefile.target
  136. Makefile.user
  137. microblaze-dis.c
  138. migration-exec.c
  139. migration-fd.c
  140. migration-tcp.c
  141. migration-unix.c
  142. migration.c
  143. migration.h
  144. mips-dis.c
  145. mips.ld
  146. module.c
  147. module.h
  148. monitor.c
  149. monitor.h
  150. nbd.c
  151. nbd.h
  152. net-checksum.c
  153. net.c
  154. net.h
  155. osdep.c
  156. osdep.h
  157. path.c
  158. pci-ids.txt
  159. posix-aio-compat.c
  160. ppc-dis.c
  161. ppc.ld
  162. ppc64.ld
  163. qbool.c
  164. qbool.h
  165. qdict-test-data.txt
  166. qdict.c
  167. qdict.h
  168. qemu-aio.h
  169. qemu-binfmt-conf.sh
  170. qemu-char.c
  171. qemu-char.h
  172. qemu-common.h
  173. qemu-config.c
  174. qemu-config.h
  175. qemu-doc.texi
  176. qemu-img-cmds.hx
  177. qemu-img.c
  178. qemu-img.texi
  179. qemu-io.c
  180. qemu-lock.h
  181. qemu-log.h
  182. qemu-malloc.c
  183. qemu-monitor.hx
  184. qemu-nbd.c
  185. qemu-nbd.texi
  186. qemu-objects.h
  187. qemu-option.c
  188. qemu-option.h
  189. qemu-options.hx
  190. qemu-queue.h
  191. qemu-sockets.c
  192. qemu-tech.texi
  193. qemu-thread.c
  194. qemu-thread.h
  195. qemu-timer.h
  196. qemu-tool.c
  197. qemu.sasl
  198. qemu_socket.h
  199. qerror.c
  200. qerror.h
  201. qfloat.c
  202. qfloat.h
  203. qint.c
  204. qint.h
  205. qjson.c
  206. qjson.h
  207. qlist.c
  208. qlist.h
  209. qobject.h
  210. qstring.c
  211. qstring.h
  212. readline.c
  213. readline.h
  214. README
  215. rules.mak
  216. s390-dis.c
  217. s390.ld
  218. savevm.c
  219. sdl.c
  220. sdl_keysym.h
  221. sdl_zoom.c
  222. sdl_zoom.h
  223. sdl_zoom_template.h
  224. sh4-dis.c
  225. softmmu-semi.h
  226. softmmu_defs.h
  227. softmmu_exec.h
  228. softmmu_header.h
  229. softmmu_template.h
  230. sparc-dis.c
  231. sparc.ld
  232. sparc64.ld
  233. sysemu.h
  234. targphys.h
  235. tcg-runtime.c
  236. texi2pod.pl
  237. thunk.c
  238. thunk.h
  239. TODO
  240. translate-all.c
  241. uboot_image.h
  242. usb-bsd.c
  243. usb-linux.c
  244. usb-stub.c
  245. VERSION
  246. vgafont.h
  247. vl.c
  248. vnc-auth-sasl.c
  249. vnc-auth-sasl.h
  250. vnc-auth-vencrypt.c
  251. vnc-auth-vencrypt.h
  252. vnc-tls.c
  253. vnc-tls.h
  254. vnc.c
  255. vnc.h
  256. vnc_keysym.h
  257. vnchextile.h
  258. x86_64.ld
  259. x_keymap.c
  260. x_keymap.h