From: Dave Hart Date: Wed, 25 Apr 2012 03:53:28 +0000 (+0000) Subject: [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus. X-Git-Tag: NTP_4_2_7P274~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27b861ca20d4e841e57a1c44f236e8f71971137f;p=thirdparty%2Fntp.git [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus. bk: 4f977538vSbggvS_YF9ghX5jiRw1Bg --- diff --git a/ChangeLog b/ChangeLog index dc64d1a33..06189d78e 100644 --- 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 * [Bug 2141] handle_sigio() calls get_systime(), which must be reentrant when SIGIO is used. Sanity checks relative to the prior diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 787ea560a..209b09df6 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -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);