1. 15 7月, 2017 2 次提交
  2. 28 5月, 2017 1 次提交
    • M
      slirp: fix leak · 7d824696
      Marc-André Lureau 提交于
      Spotted by ASAN:
      
      /x86_64/hmp/pc-0.12:
      =================================================================
      ==22538==ERROR: LeakSanitizer: detected memory leaks
      
      Direct leak of 224 byte(s) in 1 object(s) allocated from:
          #0 0x7f0f63cdee60 in malloc (/lib64/libasan.so.3+0xc6e60)
          #1 0x556f11ff32d7 in tcp_newtcpcb /home/elmarco/src/qemu/slirp/tcp_subr.c:250
          #2 0x556f11fdb1d1 in tcp_listen /home/elmarco/src/qemu/slirp/socket.c:688
          #3 0x556f11fca9d5 in slirp_add_hostfwd /home/elmarco/src/qemu/slirp/slirp.c:1052
          #4 0x556f11f8db41 in slirp_hostfwd /home/elmarco/src/qemu/net/slirp.c:506
          #5 0x556f11f8dd83 in hmp_hostfwd_add /home/elmarco/src/qemu/net/slirp.c:535
      
      There might be a better way to fix this, but calling slirp tcp_close()
      doesn't work.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      7d824696
  3. 26 2月, 2017 1 次提交
  4. 15 11月, 2016 1 次提交
  5. 12 7月, 2016 1 次提交
  6. 04 7月, 2016 2 次提交
  7. 18 5月, 2016 1 次提交
  8. 29 4月, 2016 1 次提交
  9. 07 4月, 2016 3 次提交
  10. 15 3月, 2016 4 次提交
  11. 05 2月, 2016 1 次提交
    • P
      slirp: Clean up includes · 7df7482b
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-10-git-send-email-peter.maydell@linaro.org
      7df7482b
  12. 04 2月, 2016 4 次提交
  13. 12 11月, 2015 1 次提交
  14. 03 10月, 2013 1 次提交
  15. 01 9月, 2013 1 次提交
  16. 22 3月, 2013 1 次提交
  17. 26 2月, 2013 1 次提交
  18. 22 2月, 2013 1 次提交
    • S
      slirp: switch to GPollFD · 8917c3bd
      Stefan Hajnoczi 提交于
      Slirp uses rfds/wfds/xfds more extensively than other QEMU components.
      
      The rarely-used out-of-band TCP data feature is used.  That means we
      need the full table of select(2) to g_poll(3) events:
      
        rfds -> G_IO_IN | G_IO_HUP | G_IO_ERR
        wfds -> G_IO_OUT | G_IO_ERR
        xfds -> G_IO_PRI
      
      I came up with this table by looking at Linux fs/select.c which maps
      select(2) to poll(2) internally.
      
      Another detail to watch out for are the global variables that reference
      rfds/wfds/xfds during slirp_select_poll().  sofcantrcvmore() and
      sofcantsendmore() use these globals to clear fd_set bits.  When
      sofcantrcvmore() is called, the wfds bit is cleared so that the write
      handler will no longer be run for this iteration of the event loop.
      
      This actually seems buggy to me since TCP connections can be half-closed
      and we'd still want to handle data in half-duplex fashion.  I think the
      real intention is to avoid running the read/write handler when the
      socket has been fully closed.  This is indicated with the SS_NOFDREF
      state bit so we now check for it before invoking the TCP write handler.
      Note that UDP/ICMP code paths don't care because they are
      connectionless.
      
      Note that slirp/ has a lot of tabs and sometimes mixed tabs with spaces.
      I followed the style of the surrounding code.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1361356113-11049-6-git-send-email-stefanha@redhat.com
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8917c3bd
  19. 25 7月, 2011 1 次提交
    • B
      Wrap recv to avoid warnings · 00aa0040
      Blue Swirl 提交于
      Avoid warnings like these by wrapping recv():
        CC    slirp/ip_icmp.o
      /src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
      /src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]
      /usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *'
      
      Remove also casts used to avoid warnings.
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      00aa0040
  20. 23 7月, 2011 1 次提交
  21. 25 7月, 2010 1 次提交
  22. 21 4月, 2010 1 次提交
  23. 07 3月, 2010 1 次提交
  24. 04 12月, 2009 1 次提交
  25. 28 8月, 2009 1 次提交
    • E
      slirp: Read host DNS config on demand · df7a86ed
      Ed Swierk 提交于
      Currently the qemu user-mode networking stack reads the host DNS
      configuration (/etc/resolv.conf or the Windows equivalent) only once
      when qemu starts.  This causes name lookups in the guest to fail if the
      host is moved to a different network from which the original DNS servers
      are unreachable, a common occurrence when the host is a laptop.
      
      This patch changes the slirp code to read the host DNS configuration on
      demand, caching the results for at most 1 second to avoid unnecessary
      overhead if name lookups occur in rapid succession.  On non-Windows
      hosts, /etc/resolv.conf is re-read only if the file has been replaced or
      if its size or mtime has changed.
      Signed-off-by: NEd Swierk <eswierk@aristanetworks.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      df7a86ed
  26. 29 6月, 2009 5 次提交