]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2174] ntpd rejects source UDP ports less than 123 as bogus.
authorDave Hart <hart@ntp.org>
Wed, 25 Apr 2012 03:53:28 +0000 (03:53 +0000)
committerDave Hart <hart@ntp.org>
Wed, 25 Apr 2012 03:53:28 +0000 (03:53 +0000)
bk: 4f977538vSbggvS_YF9ghX5jiRw1Bg

ChangeLog
ntpd/ntp_proto.c

index dc64d1a331129db0935f72d5430a02705ab70987..06189d78ec55cc0c43f2305e7d8df6c306edf3ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus.
 (4.2.7p273) 2012/04/19 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2141] handle_sigio() calls get_systime(), which must be
   reentrant when SIGIO is used.  Sanity checks relative to the prior
index 787ea560a567bd670d1402be50a8ba16846f6ca5..209b09df6808e8f59af68de4945f9790fc6c4cef 100644 (file)
@@ -394,18 +394,15 @@ receive(
         * reveals a clogging attack.
         */
        sys_received++;
-       if (SRCPORT(&rbufp->recv_srcadr) < NTP_PORT) {
+       if (0 == SRCPORT(&rbufp->recv_srcadr)) {
                sys_badlength++;
                return;                         /* bogus port */
        }
        restrict_mask = restrictions(&rbufp->recv_srcadr);
-#ifdef DEBUG
-       if (debug > 1)
-               printf("receive: at %ld %s<-%s flags %x restrict %03x\n",
+       DPRINTF(2, ("receive: at %ld %s<-%s flags %x restrict %03x\n",
                    current_time, stoa(&rbufp->dstadr->sin),
                    stoa(&rbufp->recv_srcadr),
-                   rbufp->dstadr->flags, restrict_mask);
-#endif
+                   rbufp->dstadr->flags, restrict_mask));
        pkt = &rbufp->recv_pkt;
        hisversion = PKT_VERSION(pkt->li_vn_mode);
        hisleap = PKT_LEAP(pkt->li_vn_mode);