From: Harlan Stenn Date: Thu, 28 Dec 2017 08:09:57 +0000 (-0800) Subject: sntp: show the IP of who sent us a crypto-NAK X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5f2cdf71b5c0931f2666c2d5f2251af3e0efe54;p=thirdparty%2Fntp.git sntp: show the IP of who sent us a crypto-NAK bk: 5a44a6d5XmukqsFIdOuFFkJIAeTt4A --- diff --git a/ChangeLog b/ChangeLog index 25979eac3..6aa156f96 100644 --- 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 diff --git a/sntp/networking.c b/sntp/networking.c index 21cf09a86..ecac15c26 100644 --- a/sntp/networking.c +++ b/sntp/networking.c @@ -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! */