Age | Commit message (Collapse) | Author | Files | Lines |
|
fix: honor dns server port number on macos
See merge request slirp/libslirp!153
|
|
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
|
|
|
|
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
If the socket is completely shut down just before we get our FIN ack-ed, the
socket state has SS_NOFDREF instead of SS_FCANTRCVMORE.
If the socket sees write() shut down (and we thus switch to FIN_WAIT_1), and
we get our FIN acked before seeing read() shut down, when we eventually see
that we need to start the linger2 timer.
This way, it's only if we still have a live Internet socket that we stay in
the TCPS_FIN_WAIT_2 state without a timer, and we let the host decide the
linger2 timer.
Fixes #86
(hopefully)
|
|
BSD & Linux do this to avoid non-cooperative peers, as TCP protocols usually
don't stay idle for long after one peer shuts down its side. We could
otherwise be waiting for FIN from the guest indefinitely without keepalive.
Suggested-by: Fabian Merki
|
|
rather than TCPTV_KEEP_IDLE: until it's established, we should be more
demanding.
|
|
When receiving input, we should wait for 2h before trying to probe
again for keepalive. We do not need to wake again until that.
|
|
Modified util.c to handle WSA function return values closer to specification....
See merge request slirp/libslirp!152
|
|
specification. Explicit checks for INVALID_SOCKET and SOCKET_ERROR are made.
|
|
When getting an IPv4 DNS server address, if libresolv returns
IPv4
IPv6
IPv4
IPv6
(or just IPv4 and IPv6)
we would still have found == 1 on the second iteration and thus take the
IPv6 even if it's not the proper af. We can as well just completely ignore
the non-matching af entries.
Fixes #85
|
|
Do not link tests with libslirp.map
Closes #84
See merge request slirp/libslirp!151
|
|
Fixes #84
|
|
meson: add dependency override for libslirp
See merge request slirp/libslirp!150
|
|
If libslirp is built as a Meson subproject, Meson needs to associate the
superproject's dependency('slirp') call with our libslirp_libdep variable.
The slirp.wrap file shipped in Meson wrapdb accomplishes this with:
[provide]
slirp = libslirp_libdep
But that requires wrapdb to know the name of our libslirp_libdep variable,
which changed in 04612eb31674.
Explicitly bind the pkg-config name 'slirp' to libslirp_libdep. This will
allow slirp.wrap to say:
[provide]
dependency_names = slirp
and avoid hardcoding the variable name.
|
|
Fix Meson warnings
See merge request slirp/libslirp!149
|
|
Fix Meson warning:
meson.build:32: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build.
|
|
Fix Meson warning:
NOTICE: Future-deprecated features used:
* 1.1.0: {'"boolean option" keyword argument "value" of type str'}
|
|
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
Meson (meson.build):
- Add "target_winver" (default: "") option to support Windows versions
earlier Windows 7 (0x0601, the same as glib.) This sets a compiler
command-line define "-DTARGET_WINVER=${target_winver}", which
unconditionally sets WINVER and _WIN32_WINNT to select the requested
target Windows API.
Ref: https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt
- Clean up building the static library.
- Build the static library when "-Dstatic=true" is present on the
command line, not just when doing fuzz testing.
- Add the "*_STATIC_COMPILATION" defines to the compiler's command
line. For Windows, ensure that libiconv is an explicit dependency
since "pkg-config --libs --static" fails to add it as a dependency
library.
|
|
|
|
for Windows versions earlier than Windows 7.
|
|
|
|
if TARGET_WINVER is defined.
|
|
- sbcopy(): Make the code a little clearer to follow, with comments.
- Type consistency
- Eliminate type slices (size_t -> int)
- Use ssize_t when doing pointer arithmetic.
- Eliminate signed/unsigned comparisons.
- Add range checking assertions.
|
|
fix for slirp ftp proxying putting slirp placeholder host ip in PORT commands
Closes #82
See merge request slirp/libslirp!147
|
|
Fixes #82
|
|
Prefer g_strerror() to strerror()
See merge request slirp/libslirp!146
|
|
vmstate.h: Prefer __typeof__ vice typeof
See merge request slirp/libslirp!145
|
|
Use g_strerror() for better cross platform compatibility: glib handles
the Windows "deprecation" (i.e., use strerror_s instead of strerror),
fewer warnings at compile time.
|
|
Clang masquerading as gcc on macOS (i.e., "gcc") borks on typeof(), but
happily accepts __typeof__().
N.B., __typeof__ has been accepted by GCC and Clang for a long time, and
recently MS decided to support it as well.
|
|
cksum: NetBSD-adapted cksum()
See merge request slirp/libslirp!144
|
|
|
|
Update cksum() to use more recent NetBSD-based checksum implementation.
The updated implementation includes both a 64-bit and 32-bit (the
default) implementations. The 64-bit implementation has a longer stride
length, which may be beneficial to overall performance.
Update the return types for cksum() and ip6_cksum() to uint16_t, which
is what the checksum algorithm computes.
|
|
|
|
arp_table: use size_t to index arrays.
See merge request slirp/libslirp!142
|
|
|
|
Debugging API
See merge request slirp/libslirp!139
|
|
|
|
slirp_(un)register_poll_socket: void returning value
See merge request slirp/libslirp!141
|
|
void functions don't return values.
|
|
as they were before 72f85005a230 ("socket abstraction: slirp_os_socket"):
that broke the ABI. Better introduce SlirpAddPollCbSocket,
{,un}register_poll_socket that people can use instead, and wrappers for
the old API, for a smooth API/ABI upgrade.
|
|
Fixes 72f85005a230 ("socket abstraction: slirp_os_socket")
|
|
Found by ALT Linux Team.
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Fixes #80
|
|
Use a typedef to abstract socket identifiers because Windows just has to
be different (SOCKET type.) Moreover, SOCKET on Win64 is 64-bits and
generates copious type slicing warnings.
Other related changes:
- Explicitly cast curtime's assignment to unsigned int to tamp down on
type slicing warning.
- Ensure that errno.h is always included. Important for Windows, which
would otherwise #define errno as WSAGetLastError(); errno.h #define-s
errno as a function, i.e., "*errno()".
- Export slirp_inet_aton() utility function for Win32/64.
- tcpx_listen()
- WSASetLastError() unnecessary.
- Use have_valid_socket() to check socket in error cleanup code
(vs. "s >= 0").
|
|
Bug fix: tcpx_listen() needs to invoke the socket's register_poll_fd()
callback so that platforms can add the socket to their collection of
sockets-of-interest (primarily Windows, also platforms that use select()
and not poll()).
Same for udpx_listen(). Register the created socket!
For Windows, host forwarding "now works gooder!"
The socket is eventually unregistered via the two use cases in which
tcpx_listen() is used:
- slirp_add_hostfwd, slirp_add_hostxfwd: The corresponding "remove"
functions (slirp_remove_hostfwd, slirp_remove_hostxfwd) invoke
unregister_poll_fd().
- TCP emulation (tcp_emu() in tcp_subr.c): All calls to tcp_listen() set
the SS_FACCEPTONCE flag, making the accept() a one-shot event. By
carefully examining tcp_subr.c, lines 523-531, one sees that
tcp_connect() unregisters the one-shot accept().
QED.
|
|
bootp: Fill siaddr with tftp addr if supplied as per RFC2131
See merge request slirp/libslirp!135
|
|
Signed-off-by: Arusekk <arek_koz@o2.pl>
|
|
windows: allow static linking with LIBSLIRP_STATIC macro
See merge request slirp/libslirp!134
|
|
When the macro is defined it will help to link with libslirp statically.
Otherwise, dllimport attribute is added with function symbols and linker
errors are shown as following for static linking.
undefined reference to `__imp_slirp_input'
undefined reference to `__imp_slirp_cleanup'
undefined reference to `__imp_slirp_remove_hostfwd'
etc.
|