diff options
Diffstat (limited to 'ripd/ripd.c')
-rw-r--r-- | ripd/ripd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c index 2525679c..2a093539 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -110,13 +110,9 @@ rip_route_rte (struct rip_info *rinfo) } static struct rip_info * -rip_info_new () +rip_info_new (void) { - struct rip_info *new; - - new = XMALLOC (MTYPE_RIP_INFO, sizeof (struct rip_info)); - memset (new, 0, sizeof (struct rip_info)); - return new; + return XCALLOC (MTYPE_RIP_INFO, sizeof (struct rip_info)); } void @@ -1376,6 +1372,9 @@ rip_create_socket (struct sockaddr_in *from) #ifdef RIP_RECVMSG setsockopt_pktinfo (sock); #endif /* RIP_RECVMSG */ +#ifdef IPTOS_PREC_INTERNETCONTROL + setsockopt_ipv4_tos (sock, IPTOS_PREC_INTERNETCONTROL); +#endif if (ripd_privs.change (ZPRIVS_RAISE)) zlog_err ("rip_create_socket: could not raise privs"); @@ -2697,8 +2696,7 @@ rip_redistribute_withdraw (int type) static int rip_create (void) { - rip = XMALLOC (MTYPE_RIP, sizeof (struct rip)); - memset (rip, 0, sizeof (struct rip)); + rip = XCALLOC (MTYPE_RIP, sizeof (struct rip)); /* Set initial value. */ rip->version_send = RI_RIP_VERSION_2; @@ -2978,6 +2976,7 @@ DEFUN (no_rip_route, return CMD_SUCCESS; } +#if 0 static void rip_update_default_metric (void) { @@ -2989,6 +2988,7 @@ rip_update_default_metric (void) if (rinfo->type != ZEBRA_ROUTE_RIP && rinfo->type != ZEBRA_ROUTE_CONNECT) rinfo->metric = rip->default_metric; } +#endif DEFUN (rip_default_metric, rip_default_metric_cmd, @@ -3117,10 +3117,7 @@ struct rip_distance static struct rip_distance * rip_distance_new (void) { - struct rip_distance *new; - new = XMALLOC (MTYPE_RIP_DISTANCE, sizeof (struct rip_distance)); - memset (new, 0, sizeof (struct rip_distance)); - return new; + return XCALLOC (MTYPE_RIP_DISTANCE, sizeof (struct rip_distance)); } static void @@ -3552,6 +3549,9 @@ DEFUN (show_ip_rip_status, { ri = ifp->info; + if (!ri->running) + continue; + if (ri->enable_network || ri->enable_interface) { if (ri->ri_send == RI_RIP_UNSPEC) |