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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4fee367634864f75acae11fc4d331a3a530529e;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 dc64d1a331..06189d78ec 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 787ea560a5..209b09df68 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);