Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libsa Consistently use ntohs() instead of htons() wh...



details:   https://anonhg.NetBSD.org/src/rev/dee24ca67602
branches:  trunk
changeset: 368817:dee24ca67602
user:      rin <rin%NetBSD.org@localhost>
date:      Sun Aug 07 05:51:55 2022 +0000

description:
Consistently use ntohs() instead of htons() when converting from
network to host byte order.

No binary changes both for big and little endian.

diffstat:

 sys/lib/libsa/tftp.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 1d9bf7c65af6 -r dee24ca67602 sys/lib/libsa/tftp.c
--- a/sys/lib/libsa/tftp.c      Sun Aug 07 03:08:40 2022 +0000
+++ b/sys/lib/libsa/tftp.c      Sun Aug 07 05:51:55 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tftp.c,v 1.37 2021/03/26 10:35:08 rin Exp $     */
+/*     $NetBSD: tftp.c,v 1.38 2022/08/07 05:51:55 rin Exp $     */
 
 /*
  * Copyright (c) 1996
@@ -114,7 +114,7 @@
        t = (struct tftphdr *)pkt;
        switch (ntohs(t->th_opcode)) {
        case DATA:
-               if (htons(t->th_block) != d->xid) {
+               if (ntohs(t->th_block) != d->xid) {
                        /*
                         * Expected block?
                         */



Home | Main Index | Thread Index | Old Index