From 242acf3af4605adce933906bdc053b2414181ec7 Mon Sep 17 00:00:00 2001 From: balrog Date: Sat, 10 May 2008 01:49:53 +0000 Subject: Special-case CTL_ALIAS instead of CTL_DNS in udp loopback test. At the same time remove a bogus test (tested by Jason Wessel). Quiet some gcc4 warnings from slirp compilation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4402 c046a42c-6fe2-441c-8c8c-71466251a162 --- slirp/if.c | 2 +- slirp/misc.c | 2 +- slirp/socket.c | 5 +++-- slirp/udp.c | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'slirp') diff --git a/slirp/if.c b/slirp/if.c index 67a7b6ff8..361d7f364 100644 --- a/slirp/if.c +++ b/slirp/if.c @@ -291,7 +291,7 @@ if_start(void) } /* Encapsulate the packet for sending */ - if_encap(ifm->m_data, ifm->m_len); + if_encap((uint8_t *)ifm->m_data, ifm->m_len); m_free(ifm); diff --git a/slirp/misc.c b/slirp/misc.c index 14808fe21..337f8a857 100644 --- a/slirp/misc.c +++ b/slirp/misc.c @@ -304,7 +304,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty) { int s; struct sockaddr_in addr; - int addrlen = sizeof(addr); + socklen_t addrlen = sizeof(addr); int opt; int master = -1; char *argv[256]; diff --git a/slirp/socket.c b/slirp/socket.c index 0c15132ea..75003af15 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -392,7 +392,7 @@ sorecvfrom(so) struct socket *so; { struct sockaddr_in addr; - int addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof(struct sockaddr_in); DEBUG_CALL("sorecvfrom"); DEBUG_ARG("so = %lx", (long)so); @@ -545,7 +545,8 @@ solisten(port, laddr, lport, flags) { struct sockaddr_in addr; struct socket *so; - int s, addrlen = sizeof(addr), opt = 1; + int s, opt = 1; + socklen_t addrlen = sizeof(addr); DEBUG_CALL("solisten"); DEBUG_ARG("port = %d", port); diff --git a/slirp/udp.c b/slirp/udp.c index 3f0c08b3b..0583d7e97 100644 --- a/slirp/udp.c +++ b/slirp/udp.c @@ -322,7 +322,7 @@ int udp_output(struct socket *so, struct mbuf *m, if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff)) saddr.sin_addr.s_addr = alias_addr.s_addr; else if (addr->sin_addr.s_addr == loopback_addr.s_addr || - ((so->so_faddr.s_addr & htonl(CTL_DNS)) == htonl(CTL_DNS))) + (ntohl(so->so_faddr.s_addr) & 0xff) != CTL_ALIAS) saddr.sin_addr.s_addr = so->so_faddr.s_addr; } daddr.sin_addr = so->so_laddr; @@ -410,7 +410,7 @@ static void udp_emu(struct socket *so, struct mbuf *m) { struct sockaddr_in addr; - int addrlen = sizeof(addr); + socklen_t addrlen = sizeof(addr); #ifdef EMULATE_TALK CTL_MSG_OLD *omsg; CTL_MSG *nmsg; @@ -641,7 +641,7 @@ udp_listen(port, laddr, lport, flags) { struct sockaddr_in addr; struct socket *so; - int addrlen = sizeof(struct sockaddr_in), opt = 1; + socklen_t addrlen = sizeof(struct sockaddr_in), opt = 1; if ((so = socreate()) == NULL) { free(so); -- cgit v1.2.3