4 ms·
Looks like this was something that QEMU inherited when it took code from https://en.wikipedia.org/wiki/Slirp https://en.wikipedia.org/wiki/Slirp . Even after re
by userbinator 7y ago
Looks like this was something that QEMU inherited when it took code from https://en.wikipedia.org/wiki/Slirp https://en.wikipedia.org/wiki/Slirp . Even after reading that page, I'm still not sure how it works; is it like a SOCKS proxy?
- peter_tonoli 7y agoSlirp was the equivalent of a userland, and user accessible version of SLIP. It allowed end users, to have IP equivalent connectivity if they had a shell account. This was in the days when people had dial-in accounts to a shell, and wanted to use Mosaic web browser on their machines.
- jacobush 7y agoAmiga Mosaic and FTP, also. :)
- kijiki 7y agoSlirp is a little like NAT, but implemented differently. It creates what looks like a virtual NIC (literally in qemu's case, indirectly by SLIP in the original Slirp), and reassembles the packets it gets coming in from the guest OS or SLIP user. For example, a SYN packet gets turned into a call to connect(), and a data packet gets turned into a write() on the appropriate TCP socket FD. An RST packet gets turned into a call to close(). The reverse happens in the other direction, based on the read() data, fake TCP packets are generated, a closed socket gets mapped to a RST packet, and so forth. From the outside, it looks like the guest (or SLIP user) is NATed through the host's IP address. But really it is just reassembling the intention of the guest based on the packets it is sending and calling host kernel functions to cause the same effects.
- userbinator 7y agoThanks for the explanation. Given the original purpose of the code, where it would basically see "good" packets exclusively, it's not too surprising that giving it arbitrary "weird" packets could trigger bugs.
- ptman 7y agoIs that similar to what sshuttle does?
- dahfizz 7y agoNot really. Sshuttle is really just a convenient wrapper around plain old ssh. It created an SSH tunnel to the host you specify and forwards all traffic through that. Its more like a VPN