]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
sntp: show the IP of who sent us a crypto-NAK
authorHarlan Stenn <stenn@ntp.org>
Thu, 28 Dec 2017 08:09:57 +0000 (00:09 -0800)
committerHarlan Stenn <stenn@ntp.org>
Thu, 28 Dec 2017 08:09:57 +0000 (00:09 -0800)
bk: 5a44a6d5XmukqsFIdOuFFkJIAeTt4A

ChangeLog
sntp/networking.c

index 25979eac3219a6fc77c37eaafdfbbeff4ef249ac..6aa156f96c31d3fdd09d0c5218411e7d2a930b82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -64,6 +64,7 @@
 * update-leap: updates from Paul McMath.
 * When using pkg-config, report --modversion.  HStenn.
 * Clean up libevent configure checks.  HStenn.
+* sntp: show the IP of who sent us a crypto-NAK.  HStenn.
 
 ---
 (4.2.8p10) 2017/03/21 Released by Harlan Stenn <stenn@ntp.org>
index 21cf09a86b31b43257b95e1653953a83f06f0cb1..ecac15c262a5116a4b50bd9a059768af8acda04b 100644 (file)
@@ -135,6 +135,8 @@ process_pkt (
                        func_name, pkt_len);
                return PACKET_UNUSEABLE;
        }
+
+       /* HMS: the following needs a bit of work */
        /* Note: pkt_len must be a multiple of 4 at this point! */
        packet_end = (void*)((char*)rpkt + pkt_len);
        exten_end = skip_efields(rpkt->exten, packet_end);
@@ -144,18 +146,20 @@ process_pkt (
                        func_name);
                return PACKET_UNUSEABLE;
        }
+
        /* get size of MAC in cells; can be zero */
        exten_len = (u_int)(packet_end - exten_end);
 
        /* deduce action required from remaining length */
        switch (exten_len) {
 
-       case 0: /* no MAC at all */
+       case 0: /* no Legacy MAC */
                break;
 
        case 1: /* crypto NAK */                
+               /* Only if the keyID is 0 and there were no EFs */
                key_id = ntohl(*exten_end);
-               printf("Crypto NAK = 0x%08x\n", key_id);
+               printf("Crypto NAK = 0x%08x from %s\n", key_id, stoa(sender));
                break;
 
        case 3: /* key ID + 3DES MAC -- unsupported! */