Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
recv can return ECONNABORTED due to a time-out on the socket. The socket is no longer useable once it enters this state.
|
|
Avoid a macro translation when not needed, and potentially doing really
weird things to headers.
|
|
DEBUG is set by a number of IDEs and development environments (*cough*
xcode *cough*). This means we use mbuf duplication when we don't need
(or expect) it. Change the name to SLIRP_DEBUG to enable this feature.
Signed-off-by: Pablo Fiori <pablofiori@fb.com>
Signed-off-by: Brett Nash <nash@fb.com>
|
|
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
QEMU has an issue open
(https://gitlab.com/qemu-project/qemu/-/issues/347) to forward a Unix
domain socket to guest TCP port. Both of these protocols support stream
modes of operation (and user-mode networking can only access the stream
anyway), so this patch enables Unix-to-TCP hostfwds.
Like with localhost hostfwds, the sotranslate_accept function will
translate a Unix domain socket connection to a TCP connection
originating from vhost_addr and a randomized ephemeral port.
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
|
|
Perform lazy guest address resolution for IPv6
See merge request slirp/libslirp!81
|
|
Previously QEMU rejected IPv6 host-forward attempts that had an
unspecified guest address. This is because for IPv6 the guest's
IP address isn't necessarily known ahead of time: Libslirp only
provides a "stateless" DHCPv6 server, which if the macaddr is
random then the IPv6 address is random too.
This patch changes this to do the address resolution lazily, in the
hopes that the guest's IPv6 address is known at the time the user
wants to connect to the guest. The request can still fail if the
guest doesn't have an IPv6 address yet (e.g., it's still early in
the boot). Such requests are immediately rejected.
Signed-off-by: Doug Evans <dje@google.com>
|
|
Listen v6only
See merge request slirp/libslirp!77
|
|
tcpx_listen: tcp_newtcpcb doesn't fail
See merge request slirp/libslirp!79
|
|
Debugging bind/listen failures without errno can get painful.
Signed-off-by: Doug Evans <dje@google.com>
|
|
Signed-off-by: Doug Evans <dje@google.com>
|
|
They are superseded by slirp_add/remove_hostxfwd
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
That allows to request binding on v6 addresses only.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
This actually makes most of the code simpler.
|
|
|
|
This generalizes adding hostfwd, and opens the path for cross ipv4/6
forward.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
|
|
Signed-off-by: Doug Evans <dje@google.com>
|
|
Two exported functions are added which are the ipv6 versions of their
ipv4 counterparts: slirp_add_ipv6_hostfwd, slirp_remove_ipv6_hostfwd.
Signed-off-by: Doug Evans <dje@google.com>
|
|
socket: consume empty packets
See merge request slirp/libslirp!55
|
|
it fixes a tightloop when a packet with len==0 is received.
Closes: https://github.com/rootless-containers/slirp4netns/issues/227
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
|
|
Enable forwarding ICMP errors
See merge request slirp/libslirp!49
|
|
|
|
Not all icmp errors are reported as errno errors. Linux however lets us
get them through a message error queue.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
The code is unreachable, so no need to break.
This silence static analyzer warnings.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
Fixes #16
Signed-off-by: 5eraph <5eraph@protonmail.com>
|
|
Fixes #16
Signed-off-by: 5eraph <5eraph@protonmail.com>
|
|
Oops, it turns out the variable is there for portability reasons.
This reverts commit d65f3030a82743bf506b0611a6a1a0358ea5d52b.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Currently, any address within the subnetwork will fallback on
loopback. It seems it has always been like that, but it seems wrong,
and I don't see a good reason to keep it this way. Fortunately, lack
of ARP reply made this unusable in practice, so we shouldn't break
much existing users.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Somewhat related to #16, but not as restrictive.
(imho, it should be possible to access any port on the given DNS IP,
not just 53)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
The value is only set on success.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Mem cleanups
See merge request slirp/libslirp!20
|
|
Make host receive broadcast packets
Closes #9
See merge request slirp/libslirp!15
|
|
glib mem functions are already used in various places. Let's not mix
the two, and instead abort on OOM conditions.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
avoid using getpeername(2) if the socket was already closed for
writing, as it will report the socket as disconnected.
Using getsockopt instead ensures there is no error returned.
Closes: https://gitlab.freedesktop.org/slirp/libslirp/issues/12
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
|
|
This is needed for using an external DHCP server
Fixes #9
|
|
From https://github.com/rootless-containers/slirp4netns/blob/4889f5299f407d7d7566c76a3b8b5f71c99b6db5/qemu_patches/0003-slirp-add-disable_host_loopback-prohibit-connections.patch
Original commits:
* https://github.com/rootless-containers/slirp4netns/commit/6325473781bb344c225f54e2d28800fb0619d7ee
* https://github.com/rootless-containers/slirp4netns/commit/13b24026867d4c30d5d1465ac82e3bb890bf4caa
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
|
Gcc 9 needs some convincing that sopreprbuf really is going to fill
in iov in the call from soreadbuf, even though the failure case
shouldn't happen.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190415121740.9881-1-dgilbert@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|