]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Don't allow null interfaces
authorDanny Mayer <mayer@ntp.org>
Mon, 25 Oct 2004 02:42:51 +0000 (22:42 -0400)
committerDanny Mayer <mayer@ntp.org>
Mon, 25 Oct 2004 02:42:51 +0000 (22:42 -0400)
bk: 417c682b7An86v0UVKhoJeTMpNmKCw

ntpd/ntp_peer.c

index 164b5b8f82e30968d4af1abe0ba49f93bca73797..952e91ab45bcf22cebab67cc7721d56ff2fbaa9c 100644 (file)
@@ -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
         */