From 89df2fcb41d97b9f1d4ec032e71c34067db5ec04 Mon Sep 17 00:00:00 2001 From: dlg Date: Mon, 21 Apr 2014 04:02:52 +0000 Subject: [PATCH] th_code is in network byte order --- usr.sbin/tftpd/tftpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c index b32b3e891f3..e08efc50363 100644 --- a/usr.sbin/tftpd/tftpd.c +++ b/usr.sbin/tftpd/tftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tftpd.c,v 1.18 2013/11/26 21:47:16 deraadt Exp $ */ +/* $OpenBSD: tftpd.c,v 1.19 2014/04/21 04:02:52 dlg Exp $ */ /* * Copyright (c) 2012 David Gwynne @@ -1376,7 +1376,7 @@ nak(struct tftp_client *client, int error) } if (pe->e_code < 0) { pe->e_msg = strerror(error - 100); - tp->th_code = EUNDEF; /* set 'undef' errorcode */ + tp->th_code = htons(EUNDEF); /* set 'undef' errorcode */ } length = strlcpy(tp->th_msg, pe->e_msg, client->packet_size - 5) + 5; -- 2.20.1