]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3604] Wrong param byte order passing into record_raw_stats() in ntp_io.c
authorJuergen Perlinger <perlinger@ntp.org>
Sat, 10 Aug 2019 07:03:06 +0000 (09:03 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Sat, 10 Aug 2019 07:03:06 +0000 (09:03 +0200)
bk: 5d4e6c2ap24QDpKCCTsCiFR4nS9K0Q

ChangeLog
ntpd/ntp_io.c

index 9ff845c81028eeecbd72fd587d28555bc5f781e5..7a0e9308d6e0832e18f10beb1786b17ccf9f5aca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
 ---
+* [Bug 3604] Wrong param byte order passing into record_raw_stats() in
+       ntp_io.c <perlinger@ntp.org>
+  - fixed byte and paramter order as suggested by wei6410@sina.com 
+---
 (4.2.8p13) 2019/03/07 Released by Harlan Stenn <stenn@ntp.org>
 
 * [Sec 3565] Crafted null dereference attack in authenticated
index b89b996e9310c56d2f8a66ab9ced05a9a4160ea1..3bc67904ba6cb4217ab18980a762e89bfb9f714e 100644 (file)
@@ -3134,7 +3134,8 @@ sendpkt(
        int     rc;
        u_char  cttl;
        l_fp    fp_zero = { { 0 }, 0 };
-
+       l_fp    org, rec, xmt;
+       
        ismcast = IS_MCAST(dest);
        if (!ismcast)
                src = ep;
@@ -3219,11 +3220,14 @@ sendpkt(
        } while (ismcast && src != NULL);
 
        /* HMS: pkt->rootdisp is usually random here */
+       NTOHL_FP(&pkt->org, &org);
+       NTOHL_FP(&pkt->rec, &rec);
+       NTOHL_FP(&pkt->xmt, &xmt);
        record_raw_stats(src ? &src->sin : NULL, dest,
-                       &pkt->org, &pkt->rec, &pkt->xmt, &fp_zero,
-                       PKT_MODE(pkt->li_vn_mode),
-                       PKT_VERSION(pkt->li_vn_mode),
+                       &org, &rec, &xmt, &fp_zero,
                        PKT_LEAP(pkt->li_vn_mode),
+                       PKT_VERSION(pkt->li_vn_mode),
+                       PKT_MODE(pkt->li_vn_mode),
                        pkt->stratum,
                        pkt->ppoll, pkt->precision,
                        pkt->rootdelay, pkt->rootdisp, pkt->refid,