summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
Diffstat (limited to 'ripd')
-rw-r--r--ripd/ChangeLog4
-rw-r--r--ripd/rip_debug.c2
-rw-r--r--ripd/rip_interface.c18
-rw-r--r--ripd/rip_main.c3
-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.c21
-rw-r--r--ripd/ripd.conf.sample2
9 files changed, 29 insertions, 37 deletions
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index ecf353d0..60baef5d 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,3 +1,7 @@
+2008-05-29 Stephen Hemminger <stephen.hemminger@vyatta.com>
+
+ * ripd.c: (rip_auth_md5) fix bogus empty string test
+
2008-03-13 Paul Jakma <paul.jakma@sun.com>
* ripd.c/rip_interface.c: Remove 0 entries from rip_msg
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 915cd911..131898c2 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)
@@ -253,7 +254,6 @@ rip_request_neighbor (struct in_addr addr)
rip_request_send (&to, NULL, rip->version_send, NULL);
}
-#if 0
/* Request routes at all interfaces. */
static void
rip_request_neighbor_all (void)
@@ -406,8 +406,8 @@ rip_interface_down (int command, struct zclient *zclient, zebra_size_t length)
if (IS_RIP_DEBUG_ZEBRA)
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);
+ ifp->name, ifp->ifindex,
+ (unsigned long long) ifp->flags, ifp->metric, ifp->mtu);
return 0;
}
@@ -427,7 +427,7 @@ rip_interface_up (int command, struct zclient *zclient, zebra_size_t length)
if (IS_RIP_DEBUG_ZEBRA)
zlog_debug ("interface %s index %d flags %#llx metric %d mtu %d is up",
- ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
+ ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
ifp->metric, ifp->mtu);
/* Check if this interface is RIP enabled or not.*/
@@ -492,7 +492,7 @@ rip_interface_delete (int command, struct zclient *zclient,
}
zlog_info("interface delete %s index %d flags %#llx metric %d mtu %d",
- ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
+ ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
ifp->metric, ifp->mtu);
/* To support pseudo interface do not free interface structure. */
@@ -2058,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_main.c b/ripd/rip_main.c
index dfcd6c26..0b29107d 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -236,7 +236,8 @@ main (int argc, char **argv)
break;
}
vty_port = atoi (optarg);
- vty_port = (vty_port ? vty_port : RIP_VTY_PORT);
+ if (vty_port <= 0 || vty_port > 0xffff)
+ vty_port = RIP_VTY_PORT;
break;
case 'r':
retain_mode = 1;
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 af2e5d0e..fc8ce1b8 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -76,7 +76,7 @@ enum
};
/* RIP command strings. */
-struct message rip_msg[] =
+static const struct message rip_msg[] =
{
{RIP_REQUEST, "REQUEST"},
{RIP_RESPONSE, "RESPONSE"},
@@ -84,6 +84,7 @@ struct message rip_msg[] =
{RIP_TRACEOFF, "TRACEOFF"},
{RIP_POLL, "POLL"},
{RIP_POLL_ENTRY, "POLL ENTRY"},
+ {0, NULL},
};
/* Utility function to set boradcast option to the socket. */
@@ -111,11 +112,7 @@ rip_route_rte (struct rip_info *rinfo)
static struct rip_info *
rip_info_new ()
{
- 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
@@ -2696,8 +2693,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;
@@ -3118,10 +3114,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
@@ -3510,7 +3503,7 @@ DEFUN (show_ip_rip_status,
struct listnode *node;
struct interface *ifp;
struct rip_interface *ri;
- extern struct message ri_version_msg[];
+ extern const struct message ri_version_msg[];
const char *send_version;
const char *receive_version;
@@ -3689,7 +3682,7 @@ config_write_rip (struct vty *vty)
}
/* RIP node structure. */
-struct cmd_node rip_node =
+static struct cmd_node rip_node =
{
RIP_NODE,
"%s(config-router)# ",
diff --git a/ripd/ripd.conf.sample b/ripd/ripd.conf.sample
index f72e5e85..2902ff9c 100644
--- a/ripd/ripd.conf.sample
+++ b/ripd/ripd.conf.sample
@@ -2,7 +2,7 @@
!
! RIPd sample configuration file
!
-! $Id$
+! $Id: ripd.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
!
hostname ripd
password zebra