diff options
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 22e48db0..67a49f7a 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -96,13 +96,9 @@ bnc_nexthop_free (struct bgp_nexthop_cache *bnc) } static struct bgp_nexthop_cache * -bnc_new () +bnc_new (void) { - struct bgp_nexthop_cache *new; - - new = XMALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache)); - memset (new, 0, sizeof (struct bgp_nexthop_cache)); - return new; + return XCALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache)); } static void @@ -575,8 +571,7 @@ bgp_connected_add (struct connected *ifc) } else { - bc = XMALLOC (0, sizeof (struct bgp_connected_ref)); - memset (bc, 0, sizeof (struct bgp_connected_ref)); + bc = XCALLOC (0, sizeof (struct bgp_connected_ref)); bc->refcnt = 1; rn->info = bc; } @@ -601,8 +596,7 @@ bgp_connected_add (struct connected *ifc) } else { - bc = XMALLOC (0, sizeof (struct bgp_connected_ref)); - memset (bc, 0, sizeof (struct bgp_connected_ref)); + bc = XCALLOC (0, sizeof (struct bgp_connected_ref)); bc->refcnt = 1; rn->info = bc; } @@ -701,7 +695,7 @@ bgp_nexthop_self (afi_t afi, struct attr *attr) } static struct bgp_nexthop_cache * -zlookup_read () +zlookup_read (void) { struct stream *s; uint16_t length; @@ -748,8 +742,7 @@ zlookup_read () for (i = 0; i < nexthop_num; i++) { - nexthop = XMALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); - memset (nexthop, 0, sizeof (struct nexthop)); + nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); nexthop->type = stream_getc (s); switch (nexthop->type) { @@ -811,7 +804,7 @@ zlookup_query (struct in_addr addr) #ifdef HAVE_IPV6 static struct bgp_nexthop_cache * -zlookup_read_ipv6 () +zlookup_read_ipv6 (void) { struct stream *s; uint16_t length; @@ -858,8 +851,7 @@ zlookup_read_ipv6 () for (i = 0; i < nexthop_num; i++) { - nexthop = XMALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); - memset (nexthop, 0, sizeof (struct nexthop)); + nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); nexthop->type = stream_getc (s); switch (nexthop->type) { @@ -1285,7 +1277,7 @@ bgp_config_write_scan_time (struct vty *vty) } void -bgp_scan_init () +bgp_scan_init (void) { zlookup = zclient_new (); zlookup->sock = -1; |