]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Fix compiler warnings
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sun, 15 May 2016 17:41:23 +0000 (13:41 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 20 May 2016 13:34:32 +0000 (09:34 -0400)
Two issues:

1) nbr->oi->ifp->name is an array it would
always evaluate to true.

2) There exist a code path where addr
would be used without initialization.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
ospfd/ospf_packet.c
ospfd/ospf_vty.c

index 8bf07783e14a86c0fdbf9d67e8616999f3831f49..f5804441182465284bf706d4ab2147e0be910010 100644 (file)
@@ -4022,7 +4022,7 @@ ospf_proactively_arp (struct ospf_neighbor *nbr)
     char *str_ptr;
     int  ret;
 
-    if (!nbr || !nbr->oi || !nbr->oi->ifp || !nbr->oi->ifp->name)
+    if (!nbr || !nbr->oi || !nbr->oi->ifp)
        return;
 
     str_ptr = strcpy (ping_nbr, "ping -c 1 -I ");
index 75300fa351ceb553f263cceddc1b79ba69f9ea90..89f2e128577a06b39e41f2fae7a85c22ff4075bb 100644 (file)
@@ -361,7 +361,7 @@ DEFUN (ospf_passive_interface,
        "Interface's name\n")
 {
   struct interface *ifp;
-  struct in_addr addr;
+  struct in_addr addr = { .s_addr = INADDR_ANY };
   int ret;
   struct ospf_if_params *params;
   struct route_node *rn;
@@ -440,7 +440,7 @@ DEFUN (no_ospf_passive_interface,
        "Interface's name\n")
 {
   struct interface *ifp;
-  struct in_addr addr;
+  struct in_addr addr = { .s_addr = INADDR_ANY };
   struct ospf_if_params *params;
   int ret;
   struct route_node *rn;