summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_debug.c2
-rw-r--r--ripd/rip_interface.c30
-rw-r--r--ripd/rip_offset.c6
-rw-r--r--ripd/rip_peer.c6
-rw-r--r--ripd/rip_zebra.c4
-rw-r--r--ripd/ripd.c24
6 files changed, 36 insertions, 36 deletions
diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c
index d788ea7e..64dc27c0 100644
--- a/ripd/rip_debug.c
+++ b/ripd/rip_debug.c
@@ -203,7 +203,7 @@ DEFUN (no_debug_rip_zebra,
}
/* Debug node. */
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"", /* Debug node has no interface. */
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 7c5577b4..c019fc29 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -50,11 +50,12 @@ static int rip_enable_if_lookup (const char *ifname);
static int rip_enable_network_lookup2 (struct connected *connected);
static void rip_enable_apply_all (void);
-struct message ri_version_msg[] =
+const struct message ri_version_msg[] =
{
{RI_RIP_VERSION_1, "1"},
{RI_RIP_VERSION_2, "2"},
{RI_RIP_VERSION_1_AND_2, "1 2"},
+ {0, NULL}
};
extern struct zebra_privs_t ripd_privs;
@@ -118,8 +119,7 @@ rip_interface_new (void)
{
struct rip_interface *ri;
- ri = XMALLOC (MTYPE_RIP_INTERFACE, sizeof (struct rip_interface));
- memset (ri, 0, sizeof (struct rip_interface));
+ ri = XCALLOC (MTYPE_RIP_INTERFACE, sizeof (struct rip_interface));
/* Default authentication type is simple password for Cisco
compatibility. */
@@ -240,6 +240,7 @@ rip_request_interface (struct interface *ifp)
}
}
+#if 0
/* Send RIP request to the neighbor. */
static void
rip_request_neighbor (struct in_addr addr)
@@ -270,6 +271,7 @@ rip_request_neighbor_all (void)
if (rp->info)
rip_request_neighbor (rp->p.u.prefix4);
}
+#endif
/* Multicast packet receive socket. */
static int
@@ -403,8 +405,9 @@ rip_interface_down (int command, struct zclient *zclient, zebra_size_t length)
rip_if_down(ifp);
if (IS_RIP_DEBUG_ZEBRA)
- zlog_debug ("interface %s index %d flags %ld metric %d mtu %d is down",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ zlog_debug ("interface %s index %d flags %#llx metric %d mtu %d is down",
+ ifp->name, ifp->ifindex,
+ (unsigned long long) ifp->flags, ifp->metric, ifp->mtu);
return 0;
}
@@ -423,8 +426,9 @@ rip_interface_up (int command, struct zclient *zclient, zebra_size_t length)
return 0;
if (IS_RIP_DEBUG_ZEBRA)
- zlog_debug ("interface %s index %d flags %ld metric %d mtu %d is up",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ zlog_debug ("interface %s index %d flags %#llx metric %d mtu %d is up",
+ ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
+ ifp->metric, ifp->mtu);
/* Check if this interface is RIP enabled or not.*/
rip_enable_apply (ifp);
@@ -447,8 +451,9 @@ rip_interface_add (int command, struct zclient *zclient, zebra_size_t length)
ifp = zebra_interface_add_read (zclient->ibuf);
if (IS_RIP_DEBUG_ZEBRA)
- zlog_debug ("interface add %s index %d flags %ld metric %d mtu %d",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ zlog_debug ("interface add %s index %d flags %#llx metric %d mtu %d",
+ ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
+ ifp->metric, ifp->mtu);
/* Check if this interface is RIP enabled or not.*/
rip_enable_apply (ifp);
@@ -486,8 +491,9 @@ rip_interface_delete (int command, struct zclient *zclient,
rip_if_down(ifp);
}
- zlog_info("interface delete %s index %d flags %ld metric %d mtu %d",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ zlog_info("interface delete %s index %d flags %#llx metric %d mtu %d",
+ ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
+ ifp->metric, ifp->mtu);
/* To support pseudo interface do not free interface structure. */
/* if_delete(ifp); */
@@ -2052,7 +2058,7 @@ config_write_rip_network (struct vty *vty, int config_mode)
return 0;
}
-struct cmd_node interface_node =
+static struct cmd_node interface_node =
{
INTERFACE_NODE,
"%s(config-if)# ",
diff --git a/ripd/rip_offset.c b/ripd/rip_offset.c
index e7d71f6c..0155f90e 100644
--- a/ripd/rip_offset.c
+++ b/ripd/rip_offset.c
@@ -63,11 +63,7 @@ strcmp_safe (const char *s1, const char *s2)
static struct rip_offset_list *
rip_offset_list_new (void)
{
- struct rip_offset_list *new;
-
- new = XMALLOC (MTYPE_RIP_OFFSET_LIST, sizeof (struct rip_offset_list));
- memset (new, 0, sizeof (struct rip_offset_list));
- return new;
+ return XCALLOC (MTYPE_RIP_OFFSET_LIST, sizeof (struct rip_offset_list));
}
static void
diff --git a/ripd/rip_peer.c b/ripd/rip_peer.c
index e0617890..fd912eba 100644
--- a/ripd/rip_peer.c
+++ b/ripd/rip_peer.c
@@ -36,11 +36,7 @@ struct list *peer_list;
static struct rip_peer *
rip_peer_new (void)
{
- struct rip_peer *new;
-
- new = XMALLOC (MTYPE_RIP_PEER, sizeof (struct rip_peer));
- memset (new, 0, sizeof (struct rip_peer));
- return new;
+ return XCALLOC (MTYPE_RIP_PEER, sizeof (struct rip_peer));
}
static void
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index b924199f..c476d8f4 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -233,6 +233,7 @@ DEFUN (no_router_zebra,
return CMD_SUCCESS;
}
+#if 0
static int
rip_redistribute_set (int type)
{
@@ -246,6 +247,7 @@ rip_redistribute_set (int type)
return CMD_SUCCESS;
}
+#endif
static int
rip_redistribute_unset (int type)
@@ -651,7 +653,7 @@ config_write_rip_redistribute (struct vty *vty, int config_mode)
}
/* Zebra node structure. */
-struct cmd_node zebra_node =
+static struct cmd_node zebra_node =
{
ZEBRA_NODE,
"%s(config-router)# ",
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)