]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 739722: Change the way the extention and MAC fields are processed
authorHarlan Stenn <stenn@ntp.org>
Thu, 7 Aug 2014 07:07:31 +0000 (07:07 +0000)
committerHarlan Stenn <stenn@ntp.org>
Thu, 7 Aug 2014 07:07:31 +0000 (07:07 +0000)
bk: 53e325b3ovecj6kWn63KGgrccM_qzg

ChangeLog
sntp/networking.c

index 3efa28152f0b24d5a9e4ce13336493adb3bc385c..65d90059568dc7a07b704e4b9bf0c66917397d97 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* CID 739722: Change the way the extention and MAC fields are processed.
 (4.2.7p455) 2014/08/03 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2565] ntpd sometimes logs unexpected getifaddrs() errors.
 * CID 739722: Clean up the definition of the exten field of struct pkt.
index 3a6bb8e8616211dbb3d9fa2b5811dc51e94c8cb0..75c2f7140143c729665ef80482ba551ba91fbca1 100644 (file)
@@ -65,7 +65,7 @@ recvdata(
 /* Parsing from a short 'struct pkt' directly is bound to create
  * coverity warnings. These are hard to avoid, as the formal declaration
  * does not reflect the true layout in the presence of autokey extension
- * fields. Parsing and skipping the extension fields od a received paket
+ * fields. Parsing and skipping the extension fields of a received packet
  * until there's only the MAC left is better done in this separate
  * function.
  */
@@ -109,7 +109,7 @@ process_pkt (
        int             mac_size;
        u_int           exten_len;
        u_int32 *       exten_end;
-       u_int32 *       paket_end;
+       u_int32 *       packet_end;
        l_fp            sent_xmt;
        l_fp            resp_org;
 
@@ -136,13 +136,13 @@ unusable:
                        func_name, pkt_len);
                return PACKET_UNUSEABLE;
        }
-       /* Note: pkt_len is a multiple of 4 at this point! */
-       paket_end = (u_int32*)((char*)rpkt + pkt_len);
-       exten_end = skip_efields(rpkt->exten, paket_end);
+       /* Note: pkt_len must be a multiple of 4 at this point! */
+       packet_end = (u_int32*)((char*)rpkt + pkt_len);
+       exten_end = skip_efields(rpkt->exten, packet_end);
        if (NULL == exten_end)
                goto unusable;
        /* get size of MAC in cells; can be zero */
-       exten_len = (u_int)(paket_end - exten_end);
+       exten_len = (u_int)(packet_end - exten_end);
 
        /* deduce action required from remaining length */
        switch (exten_len) {