aboutsummaryrefslogtreecommitdiff
path: root/slirp/ip_icmp.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-03 19:58:17 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-03 19:58:17 +0000
commit8dbca8dd8a81d7f1afd6ef23b418c8f9d292b65d (patch)
treeae7373143a133db559faa9fdcf8b028f7165eb70 /slirp/ip_icmp.c
parent68cae3d8c10f914296dfc52cebe214264031df7d (diff)
downloadqemu-8dbca8dd8a81d7f1afd6ef23b418c8f9d292b65d.zip
qemu-8dbca8dd8a81d7f1afd6ef23b418c8f9d292b65d.tar.gz
qemu-8dbca8dd8a81d7f1afd6ef23b418c8f9d292b65d.tar.bz2
separate alias_addr (10.0.2.2) from our_addr (Ed Swierk)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1895 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp/ip_icmp.c')
-rw-r--r--slirp/ip_icmp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index 8bc97a0..b67a373 100644
--- a/slirp/ip_icmp.c
+++ b/slirp/ip_icmp.c
@@ -114,8 +114,7 @@ icmp_input(m, hlen)
case ICMP_ECHO:
icp->icmp_type = ICMP_ECHOREPLY;
ip->ip_len += hlen; /* since ip_input subtracts this */
- if (ip->ip_dst.s_addr == our_addr.s_addr ||
- (ip->ip_dst.s_addr == (special_addr.s_addr|htonl(CTL_ALIAS))) ) {
+ if (ip->ip_dst.s_addr == alias_addr.s_addr) {
icmp_reflect(m);
} else {
struct socket *so;
@@ -161,7 +160,7 @@ icmp_input(m, hlen)
icmp_error(m, ICMP_UNREACH,ICMP_UNREACH_NET, 0,strerror(errno));
udp_detach(so);
}
- } /* if ip->ip_dst.s_addr == our_addr.s_addr */
+ } /* if ip->ip_dst.s_addr == alias_addr.s_addr */
break;
case ICMP_UNREACH:
/* XXX? report error? close socket? */
@@ -311,7 +310,7 @@ icmp_error(msrc, type, code, minsize, message)
ip->ip_ttl = MAXTTL;
ip->ip_p = IPPROTO_ICMP;
ip->ip_dst = ip->ip_src; /* ip adresses */
- ip->ip_src = our_addr;
+ ip->ip_src = alias_addr;
(void ) ip_output((struct socket *)NULL, m);