]> git.proxmox.com Git - mirror_frr.git/blobdiff - babeld/neighbour.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / babeld / neighbour.c
index 5bf7e06fae8e2bf0d9750f30b37b80eb7c270dbd..d962a0961c9299c0a4c66c94c6458dc3d69ec2dc 100644 (file)
@@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
@@ -38,6 +42,7 @@ THE SOFTWARE.
 #include "route.h"
 #include "message.h"
 #include "resend.h"
+#include "babel_errors.h"
 
 struct neighbour *neighs = NULL;
 
@@ -89,7 +94,8 @@ find_neighbour(const unsigned char *address, struct interface *ifp)
 
     neigh = malloc(sizeof(struct neighbour));
     if(neigh == NULL) {
-        zlog_err("malloc(neighbour): %s", safe_strerror(errno));
+        flog_err(EC_BABEL_MEMORY, "malloc(neighbour): %s",
+                 safe_strerror(errno));
         return NULL;
     }
 
@@ -120,7 +126,7 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
     int rc = 0;
 
     if(hello < 0) {
-        if(neigh->hello_interval <= 0)
+        if(neigh->hello_interval == 0)
             return rc;
         missed_hellos =
             ((int)timeval_minus_msec(&babel_now, &neigh->hello_time) -
@@ -165,7 +171,6 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
     if(missed_hellos > 0) {
         neigh->reach >>= missed_hellos;
         neigh->hello_seqno = seqno_plus(neigh->hello_seqno, missed_hellos);
-        missed_hellos = 0;
         rc = 1;
     }
 
@@ -229,7 +234,7 @@ neighbour_txcost(struct neighbour *neigh)
 }
 
 unsigned
-check_neighbours()
+check_neighbours(void)
 {
     struct neighbour *neigh;
     int changed, rc;