diff options
author | Peter Maydell | 2019-01-15 19:32:57 +0100 |
---|---|---|
committer | Peter Maydell | 2019-01-15 19:32:57 +0100 |
commit | 6f2f34177a25bffd6fd92a05e6e66c8d22d97094 (patch) | |
tree | 1882acc43647e724d01c6b6057b1fc7bad70d47a /slirp/tcp_subr.c | |
parent | Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ... (diff) | |
parent | slirp: check data length while emulating ident function (diff) | |
download | qemu-6f2f34177a25bffd6fd92a05e6e66c8d22d97094.tar.gz qemu-6f2f34177a25bffd6fd92a05e6e66c8d22d97094.tar.xz qemu-6f2f34177a25bffd6fd92a05e6e66c8d22d97094.zip |
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
slirp updates
Gerd Hoffmann (1):
slirp: add tftp tracing
Marc-André Lureau (61):
slirp: associate slirp_output callback with the Slirp context
slirp: remove do_pty from fork_exec()
slirp: replace ex_pty with ex_chardev
slirp: use a dedicated field for chardev pointer
slirp: remove unused EMU_RSH
slirp: rename /extra/chardev
slirp: move internal function declarations
slirp: remove Monitor dependency, return a string for info
slirp: fix slirp_add_exec() leaks
slirp: replace the poor-man string split with g_strsplit()
slirp: remove dead declarations
slirp: move socket pair creation in helper function
slirp: remove unused M_TRAILINGSPACE
slirp: use a callback structure to interface with qemu
slirp: remove PROBE_CONN dead-code
slirp: remove FULL_BOLT
slirp: remove the disabled readv()/writev() code path
slirp: remove HAVE_SYS_SIGNAL_H
slirp: remove unused HAVE_SYS_BITYPES_H
slirp: remove NO_UNIX_SOCKETS
slirp: remove unused HAVE_SYS_STROPTS_H
slirp: remove unused HAVE_ARPA_INET_H
slirp: remove unused HAVE_SYS_WAIT_H
slirp: remove unused HAVE_SYS_SELECT_H
slirp: remove HAVE_SYS_IOCTL_H
slirp: remove HAVE_SYS_FILIO_H
slirp: remove unused DECLARE_IOVEC
slirp: remove unused HAVE_INET_ATON
slirp: replace HOST_WORDS_BIGENDIAN with glib equivalent
slirp: replace SIZEOF_CHAR_P with glib equivalent
slirp: replace compile time DO_KEEPALIVE
slirp: remove unused global slirp_instance
slirp: replace error_report() with g_critical()
slirp: improve a bit the debug macros
slirp: add a callback to log guest errors
slirp: remove #if notdef dead code
slirp: remove unused sbflush()
slirp: NULL is defined by stddef.h
slirp: remove dead TCP_ACK_HACK code
slirp: replace ARRAY_SIZE with G_N_ELEMENTS
net: do not depend on slirp internals
glib-compat: add g_spawn_async_with_fds() fallback
slirp: simplify fork_exec()
slirp: replace error_report() with g_critical()
slirp: drop <Vista compatibility
slirp: rename exec_list
slirp: use virtual time for packet expiration
slirp: replace a fprintf with g_critical()
slirp: replace some fprintf() with DEBUG_MISC
slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG
slirp: no need to make DPRINTF conditional on DEBUG
slirp: always build with debug statements
slirp: introduce SLIRP_DEBUG environment variable
slirp: use %p for pointers format
slirp: remove remaining DEBUG blocks
slirp: replace DEBUG_ARGS with DEBUG_ARG
slirp: factor out guestfwd addition checks
slirp: add clock_get_ns() callback
build-sys: use a separate slirp-obj-y && slirp.mo
slirp: set G_LOG_DOMAIN
slirp: call into g_debug() for DEBUG macros
Prasad J Pandit (1):
slirp: check data length while emulating ident function
Samuel Thibault (2):
slirp: Enable fork_exec support on Windows
slirp: Mark debugging calls as unlikely
Makefile | 5 +-
Makefile.objs | 4 +-
Makefile.target | 5 +-
include/glib-compat.h | 56 +++++++++
net/colo-compare.c | 11 +-
net/colo.c | 1 +
net/colo.h | 7 +-
net/filter-rewriter.c | 9 +-
net/slirp.c | 61 +++++----
net/util.h | 55 ++++++++
slirp/Makefile.objs | 37 +++++-
slirp/arp_table.c | 12 +-
slirp/bootp.c | 10 +-
slirp/cksum.c | 8 +-
slirp/debug.h | 47 ++++---
slirp/dhcpv6.c | 17 ++-
slirp/if.c | 4 +-
slirp/ip.h | 10 +-
slirp/ip6.h | 3 +-
slirp/ip6_icmp.c | 27 ++--
slirp/ip6_icmp.h | 6 +-
slirp/ip6_input.c | 2 +-
slirp/ip6_output.c | 4 +-
slirp/ip_icmp.c | 31 ++---
slirp/ip_input.c | 200 -----------------------------
slirp/libslirp.h | 27 ++--
slirp/main.h | 33 -----
slirp/mbuf.c | 2 +-
slirp/mbuf.h | 1 -
slirp/misc.c | 286 +++++++++++++++++-------------------------
slirp/misc.h | 13 +-
slirp/ncsi.c | 4 +-
slirp/ndp_table.c | 32 +++--
slirp/sbuf.h | 1 -
slirp/slirp.c | 177 +++++++++++++-------------
slirp/slirp.h | 45 ++-----
slirp/slirp_config.h | 86 -------------
slirp/socket.c | 53 +++-----
slirp/socket.h | 2 +-
slirp/tcp.h | 4 +-
slirp/tcp_input.c | 84 ++-----------
slirp/tcp_output.c | 2 +-
slirp/tcp_subr.c | 22 ++--
slirp/tcp_timer.c | 2 +-
slirp/tftp.c | 7 +-
slirp/trace-events | 5 +
slirp/udp.c | 5 +-
slirp/udp6.c | 11 +-
stubs/slirp.c | 2 +-
49 files changed, 603 insertions(+), 935 deletions(-)
delete mode 100644 slirp/slirp_config.h
create mode 100644 slirp/trace-events
--
2.20.1
# gpg: Signature made Mon 14 Jan 2019 22:52:32 GMT
# gpg: using RSA key DB550E89F0FA54F3
# gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>"
# gpg: aka "Samuel Thibault <sthibault@debian.org>"
# gpg: aka "Samuel Thibault <samuel.thibault@gnu.org>"
# gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>"
# gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>"
# gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>"
# gpg: aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6
# Subkey fingerprint: E61D BB15 D417 2BDE C97E 92D9 DB55 0E89 F0FA 54F3
* remotes/thibault/tags/samuel-thibault: (65 commits)
slirp: check data length while emulating ident function
slirp: Mark debugging calls as unlikely
slirp: call into g_debug() for DEBUG macros
slirp: set G_LOG_DOMAIN
build-sys: use a separate slirp-obj-y && slirp.mo
slirp: add clock_get_ns() callback
slirp: factor out guestfwd addition checks
slirp: replace DEBUG_ARGS with DEBUG_ARG
slirp: remove remaining DEBUG blocks
slirp: use %p for pointers format
slirp: introduce SLIRP_DEBUG environment variable
slirp: always build with debug statements
slirp: no need to make DPRINTF conditional on DEBUG
slirp: replace a DEBUG block with WITH_ICMP_ERROR_MSG
slirp: replace some fprintf() with DEBUG_MISC
slirp: replace a fprintf with g_critical()
slirp: use virtual time for packet expiration
slirp: rename exec_list
slirp: drop <Vista compatibility
slirp: Enable fork_exec support on Windows
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'slirp/tcp_subr.c')
-rw-r--r-- | slirp/tcp_subr.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index fa61349cbb..23a841f26e 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -420,7 +420,7 @@ int tcp_fconnect(struct socket *so, unsigned short af) qemu_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); addr = so->fhost.ss; - DEBUG_CALL(" connect()ing") + DEBUG_CALL(" connect()ing"); sotranslate_out(so, &addr); /* We don't care what port we get */ @@ -541,7 +541,6 @@ static const struct tos_t tcptos[] = { {0, 23, IPTOS_LOWDELAY, 0}, /* telnet */ {0, 80, IPTOS_THROUGHPUT, 0}, /* WWW */ {0, 513, IPTOS_LOWDELAY, EMU_RLOGIN|EMU_NOCONNECT}, /* rlogin */ - {0, 514, IPTOS_LOWDELAY, EMU_RSH|EMU_NOCONNECT}, /* shell */ {0, 544, IPTOS_LOWDELAY, EMU_KSH}, /* kshell */ {0, 543, IPTOS_LOWDELAY, 0}, /* klogin */ {0, 6667, IPTOS_THROUGHPUT, EMU_IRC}, /* IRC */ @@ -635,6 +634,11 @@ tcp_emu(struct socket *so, struct mbuf *m) socklen_t addrlen = sizeof(struct sockaddr_in); struct sbuf *so_rcv = &so->so_rcv; + if (m->m_len > so_rcv->sb_datalen + - (so_rcv->sb_wptr - so_rcv->sb_data)) { + return 1; + } + memcpy(so_rcv->sb_wptr, m->m_data, m->m_len); so_rcv->sb_wptr += m->m_len; so_rcv->sb_rptr += m->m_len; @@ -950,25 +954,23 @@ int tcp_ctl(struct socket *so) { Slirp *slirp = so->slirp; struct sbuf *sb = &so->so_snd; - struct ex_list *ex_ptr; - int do_pty; + struct gfwd_list *ex_ptr; DEBUG_CALL("tcp_ctl"); DEBUG_ARG("so = %p", so); if (so->so_faddr.s_addr != slirp->vhost_addr.s_addr) { /* Check if it's pty_exec */ - for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) { + for (ex_ptr = slirp->guestfwd_list; ex_ptr; ex_ptr = ex_ptr->ex_next) { if (ex_ptr->ex_fport == so->so_fport && so->so_faddr.s_addr == ex_ptr->ex_addr.s_addr) { - if (ex_ptr->ex_pty == 3) { + if (ex_ptr->ex_chardev) { so->s = -1; - so->extra = (void *)ex_ptr->ex_exec; + so->chardev = ex_ptr->ex_chardev; return 1; } - do_pty = ex_ptr->ex_pty; - DEBUG_MISC((dfd, " executing %s\n", ex_ptr->ex_exec)); - return fork_exec(so, ex_ptr->ex_exec, do_pty); + DEBUG_MISC(" executing %s", ex_ptr->ex_exec); + return fork_exec(so, ex_ptr->ex_exec); } } } |