From: Henry N. <hen...@ar...> - 2008-06-23 20:36:34
|
Henry Nestler wrote: > Hello Mike, > > Mike Frysinger wrote: >> On Sun, Jun 22, 2008 at 4:59 PM, Henry Nestler wrote: >>> The difference for coLinux 0.7.1 and 0.7.3 are very small. Mostly are >>> fixups for compiler warnings. >>> >>> There exist an other interesting change between versions: >>> http://colinux.svn.sourceforge.net/viewvc/colinux?view=rev&revision=574 >> so there may be a discrepancy when i said "0.7.1". i was given an old >> coLinux installer and was told it was "0.7.1". i assumed everything >> in the package was "0.7.1"; the person before me may have taken an >> older slirp daemon and dropped it in for this same reason. so as to >> make things maintainable, i started fresh with the 0.7.3 release from >> colinux.org, hit this bug, and then copied the slirp daemon from this >> "0.7.1" version. >> >> so let's just focus on the svn info i posted otherwise as that is used >> in conjunction with vanilla 0.7.3 install without any unknown baggage. >> sorry for any confusion. >> -mike >> > > With rev 479/480 you pointed to a bigger set of changes. > > By the while I found the place where it goes wrong. Please see the > source snip or: > http://colinux.svn.sourceforge.net/viewvc/colinux/branches/devel/src/colinux/user/slirp/udp.c?revision=677&view=markup > > file udp.c, line 323, function udp_output() > > In the line 323 the source address saddr.sin_addr (192.168.x.x) is > overwritten with 10.0.2.2 > One line before was checked the listen address (so->so_faddr). > I'm afraid, there should check the source address instead? But why there > is a check for broadcast? Is that a hack for a hack? It sems me, that it > would better work without the lines from 322 to 326 there? > > Background: > special_addr = 10.0.2.2 (const) Typofix. That is correctly: special_addr = 10.0.2.0 (const) alias_addr = 10.0.2.2 (const) > > All UDP sockets are listen on address 0.0.0.0, that address is set as > faked address 10.0.2.2 in line 383: > "so->so_faddr = alias_addr;" > > ----------------------------------- > devel/src/colinux/user/slirp/udp.c > 315 int udp_output(struct socket *so, struct mbuf *m, > 316 struct sockaddr_in *addr) > 317 > 318 { > 319 struct sockaddr_in saddr, daddr; > 320 > 321 saddr = *addr; > 322 if ((so->so_faddr.s_addr & htonl(0xffffff00)) == > special_addr.s_addr) { > 323 saddr.sin_addr.s_addr = so->so_faddr.s_addr; > 324 if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff)) > 325 saddr.sin_addr.s_addr = alias_addr.s_addr; > 326 } > 327 daddr.sin_addr = so->so_laddr; > 328 daddr.sin_port = so->so_lport; > 329 > 330 return udp_output2(so, m, &saddr, &daddr, so->so_iptos); > 331 } > -- Henry N. |