aboutsummaryrefslogtreecommitdiff
path: root/slirp/udp.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-10 01:49:53 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-10 01:49:53 +0000
commit242acf3af4605adce933906bdc053b2414181ec7 (patch)
treef8bd5bae08f15ee08398c1b42b2cae6ee0c8557e /slirp/udp.c
parente62ab7a153c92d6233a4eec432ac0c42c5d336c0 (diff)
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
Diffstat (limited to 'slirp/udp.c')
-rw-r--r--slirp/udp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/slirp/udp.c b/slirp/udp.c
index 3f0c08b3b1..0583d7e979 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);