From: Samuel Thibault <samuel.thibault@gnu.org>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Vincent Bernat <Vincent.Bernat@exoscale.ch>,
Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>,
Vincent Bernat <vincent@bernat.im>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [Qemu-devel] [v2] tftp: fake support for netascii protocol
Date: Mon, 21 Nov 2016 16:05:41 +0100 [thread overview]
Message-ID: <20161121150541.GA728@var.bordeaux.inria.fr> (raw)
In-Reply-To: <20161121144616.GG15478@stefanha-x1.localdomain>
Stefan Hajnoczi, on Mon 21 Nov 2016 14:46:16 +0000, wrote:
> On Sun, Nov 20, 2016 at 09:41:36AM +0100, Vincent Bernat wrote:
> > From: Vincent Bernat <vincent@bernat.im>
> >
> > Some network equipments are requesting a file using the netascii
> > protocol and this is not configurable. Currently, qemu's tftpd only
> > supports the octet protocol. This commit makes it accept the netascii
> > protocol as well but do not perform the requested transformation (LF ->
> > CR,LF) as it would be far more complex. The current implementation is
> > good enough. A user has always the choice to preencode the served file
> > correctly.
> >
> > Signed-off-by: Vincent Bernat <vincent@bernat.im>
> > ---
> > slirp/tftp.c | 11 ++++++++---
> > 1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/slirp/tftp.c b/slirp/tftp.c
> > index c1859066ccb2..6907d5b92074 100644
> > --- a/slirp/tftp.c
> > +++ b/slirp/tftp.c
> > @@ -26,6 +26,7 @@
> > #include "slirp.h"
> > #include "qemu-common.h"
> > #include "qemu/cutils.h"
> > +#include "qemu/log.h"
> >
> > static inline int tftp_session_in_use(struct tftp_session *spt)
> > {
> > @@ -326,13 +327,17 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas,
> > return;
> > }
> >
> > - if (strcasecmp(&tp->x.tp_buf[k], "octet") != 0) {
> > + if (strcasecmp(&tp->x.tp_buf[k], "octet") == 0) {
> > + k += 6;
> > + } else if (strcasecmp(&tp->x.tp_buf[k], "netascii") == 0) {
> > + qemu_log_mask(LOG_UNIMP, "tftp: netascii protocol not implemented, "
> > + "no CR-LF conversion\n");
> > + k += 9;
> > + } else {
>
> This is an RFC violation. I don't think it's suitable for upstream QEMU.
>
> The commit description says it would be "far more complex" to implement
> netascii. Is the LF -> CR LF and CR -> CR NUL transformation so hard?
I guess the question is that while the patch above could be accepted for
the upcoming 2.8 (I don't see it breaking existing systems), a patch
that would implement the transformation would be a lot more involved,
and really not suitable for 2.8.
Samuel
next prev parent reply other threads:[~2016-11-21 15:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 17:51 [Qemu-devel] [PULL] tftp: fake support for netascii protocol Samuel Thibault
2016-11-18 17:51 ` Samuel Thibault
2016-11-18 17:55 ` no-reply
2016-11-19 7:32 ` Thomas Huth
2016-11-19 8:03 ` Vincent Bernat
2016-11-19 22:30 ` Samuel Thibault
2016-11-20 8:41 ` [Qemu-devel] [v2] " Vincent Bernat
2016-11-20 8:44 ` no-reply
2016-11-20 8:44 ` no-reply
2016-11-21 7:35 ` Thomas Huth
2016-11-21 14:46 ` Stefan Hajnoczi
2016-11-21 14:51 ` hpa
2016-11-21 15:05 ` Samuel Thibault [this message]
2016-11-21 15:28 ` hpa
2016-11-22 10:49 ` Stefan Hajnoczi
2016-11-23 7:30 ` Vincent Bernat
2016-11-23 9:34 ` Stefan Hajnoczi
2016-11-21 15:35 ` Vincent Bernat
2016-11-21 15:38 ` hpa
2016-11-20 8:42 ` [Qemu-devel] [PULL] " Vincent Bernat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161121150541.GA728@var.bordeaux.inria.fr \
--to=samuel.thibault@gnu.org \
--cc=Vincent.Bernat@exoscale.ch \
--cc=hpa@zytor.com \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=vincent@bernat.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).