From: Danny Mayer Date: Mon, 25 Oct 2004 02:42:51 +0000 (-0400) Subject: Don't allow null interfaces X-Git-Tag: NTP_4_2_3~104^2~5^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70782f01a06dcbdaabef58b301090a207ffbca19;p=thirdparty%2Fntp.git Don't allow null interfaces bk: 417c682b7An86v0UVKhoJeTMpNmKCw --- diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index 164b5b8f82..952e91ab45 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -591,6 +591,14 @@ newpeer( else peer->dstadr = findinterface(srcadr); + /* + * If we can't find an interface to use we return a NULL + */ + if (peer->dstadr == NULL) + { + msyslog(LOG_ERR, "Cannot find suitable interface for address %s", stoa(srcadr)); + return (NULL); + } /* * Broadcast needs the socket enabled for broadcast */