qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] one bug and one suggestion
@ 2005-04-11 14:33 Cedric Roux
  2005-04-12  9:40 ` Magnus Damm
  0 siblings, 1 reply; 2+ messages in thread
From: Cedric Roux @ 2005-04-11 14:33 UTC (permalink / raw)
  To: qemu-devel

Dear Qemu people,

there is a bug in slirp/udp.c for tftp handling.
You do:
        if (ntohs(uh->uh_dport) == TFTP_SERVER) {
            tftp_input(m);
            goto bad;
        }
You don't test if the destination is the emulator
or the outside world. So, if I want to connect to another
computer running a tftp server, qemu will instead take
the hand.
This bug exists while using -user-net. Don't know for
tun/tap, I am not root here.

Now, for a suggestion.
There is the -tftp option. It would be a good idea
to add some option like -tftp-relative-names or something
like that so that the client can ask for a file /foo/bar.dummy
and get access to this file under the tftp directory.

To be clear: you run qemu -tftp /tftp/directory/something
and the client inside qemu asks for /foo/bar.dummy, but
effectively accesses /tftp/directory/something/foo/bar.dummy.
The client does not have to ask for
/tftp/directory/something/foo/bar.dummy
Get the point?
It seems more natural to me. What do you think?

Anyway, qemu is a nice software.

Take care of yourself,
Cedric.

PS: I am not on the mailing-list, so if you need to reply
to me, use this email-address, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] one bug and one suggestion
  2005-04-11 14:33 [Qemu-devel] one bug and one suggestion Cedric Roux
@ 2005-04-12  9:40 ` Magnus Damm
  0 siblings, 0 replies; 2+ messages in thread
From: Magnus Damm @ 2005-04-12  9:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cedric.Roux

Cedric, All,

On 4/11/05, Cedric Roux <Cedric.Roux@eurecom.fr> wrote:
> Dear Qemu people,
> 
> there is a bug in slirp/udp.c for tftp handling.
> You do:
>         if (ntohs(uh->uh_dport) == TFTP_SERVER) {
>             tftp_input(m);
>             goto bad;
>         }
> You don't test if the destination is the emulator
> or the outside world. So, if I want to connect to another
> computer running a tftp server, qemu will instead take
> the hand.
> This bug exists while using -user-net. Don't know for
> tun/tap, I am not root here.

Yes, you are correct what I can tell. I thought that only data for the
emulated server went through that path so I copied the BOOTP code, but
I now realize that the BOOTP case handles broadcast data. Care to make
a patch?

> Now, for a suggestion.
> There is the -tftp option. It would be a good idea
> to add some option like -tftp-relative-names or something
> like that so that the client can ask for a file /foo/bar.dummy
> and get access to this file under the tftp directory.
> 
> To be clear: you run qemu -tftp /tftp/directory/something
> and the client inside qemu asks for /foo/bar.dummy, but
> effectively accesses /tftp/directory/something/foo/bar.dummy.
> The client does not have to ask for
> /tftp/directory/something/foo/bar.dummy
> Get the point?
> It seems more natural to me. What do you think?

I agree it is more natural. But I was lazy and I wanted to keep it
simple. And there are several limitations that comes with TFTP such as
limited file size, no directory listing and so on so I would like to
keep the TFTP server as simple as possible, ie read only. I hope that
someone will hack together a webdav or FTP server that makes it easy
to transfer files for normal users too.

Thanks,

/ magnus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-12  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-11 14:33 [Qemu-devel] one bug and one suggestion Cedric Roux
2005-04-12  9:40 ` Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).