From: Donald Sharp Date: Sun, 15 May 2016 17:41:23 +0000 (-0400) Subject: ospfd: Fix compiler warnings X-Git-Tag: frr-2.0-rc1~892 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=cb2af5d07aa71150113ec28ad1945ef9ee8546ae;p=mirror%2Ffrr.git ospfd: Fix compiler warnings 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 Reviewed-by: Daniel Walton --- diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 8bf07783e1..f580444118 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -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 "); diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 75300fa351..89f2e12857 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -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;