mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
Slirp cleanups.
This commit is contained in:
parent
fa8d3ce3bc
commit
6134c9bc70
@ -81,7 +81,7 @@ void ip_input(struct mbuf *m)
|
||||
|
||||
DEBUG_CALL("ip_input");
|
||||
DEBUG_ARG("m = %p", m);
|
||||
DEBUG_ARG("m_len = %d", m->m_len);
|
||||
DEBUG_ARG("m_len = %zu", m->m_len);
|
||||
|
||||
ipstat.ips_total++;
|
||||
|
||||
|
||||
@ -121,13 +121,13 @@ static int get_dns_addr(struct in_addr *pdns_addr)
|
||||
|
||||
#endif
|
||||
|
||||
static int inited;
|
||||
|
||||
int slirp_init(void)
|
||||
{
|
||||
// debug_init("/tmp/slirp.log", DEBUG_DEFAULT);
|
||||
|
||||
#ifdef _WIN32
|
||||
static int inited;
|
||||
|
||||
if (!inited) {
|
||||
WSADATA Data;
|
||||
WSAStartup(MAKEWORD(2,0), &Data);
|
||||
|
||||
@ -50,8 +50,20 @@ typedef unsigned long ioctlsockopt_t;
|
||||
# define write_udp slirp_write_udp
|
||||
# define init_udp slirp_init_udp
|
||||
# define final_udp slirp_final_udp
|
||||
#else
|
||||
#else //!_WIN32
|
||||
typedef int ioctlsockopt_t;
|
||||
|
||||
# define WSAGetLastError() (int)(errno)
|
||||
# define WSASetLastError(e) (void)(errno = (e))
|
||||
# define WSAEWOULDBLOCK EWOULDBLOCK
|
||||
# define WSAEINPROGRESS EINPROGRESS
|
||||
# define WSAENOTCONN ENOTCONN
|
||||
# define WSAEHOSTUNREACH EHOSTUNREACH
|
||||
# define WSAENETUNREACH ENETUNREACH
|
||||
# define WSAECONNREFUSED ECONNREFUSED
|
||||
|
||||
# define SLIRP_SOCKET int
|
||||
|
||||
# define ioctlsocket ioctl
|
||||
# define closesocket(s) close(s)
|
||||
# define O_BINARY 0
|
||||
|
||||
@ -1072,7 +1072,7 @@ findso:
|
||||
if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
|
||||
tcpstat.tcps_rcvdupack++;
|
||||
DEBUG_MISC((" dup ack m = %p so = %p \n",
|
||||
(long)m, (long)so));
|
||||
m, so));
|
||||
/*
|
||||
* If we have outstanding data (other than
|
||||
* a window probe), this is a completely
|
||||
|
||||
@ -341,7 +341,7 @@ SLIRP_SOCKET udp_attach(struct socket *so)
|
||||
if(bind(so->s, (struct sockaddr *)&addr, sizeof(addr))<0) {
|
||||
int error = WSAGetLastError();
|
||||
closesocket(so->s);
|
||||
so->s =- 1;
|
||||
so->s = -1;
|
||||
WSASetLastError(error);
|
||||
} else {
|
||||
/* success, insert in queue */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user