summaryrefslogtreecommitdiff
path: root/usr.sbin/ripd
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2007-03-31 09:49:21 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2007-03-31 09:49:21 +0000
commit5a42afe80d6338a1bc0642cd5555825421d37b66 (patch)
treea0807a61e1203dbb80398f883d752f5ac8192cab /usr.sbin/ripd
parent1acc7ee3a83439aed3fb78e0b41a86d07f101c3e (diff)
Some code cleanups. Added one lint command, removed one unused function and
some other cosmetics.
Diffstat (limited to 'usr.sbin/ripd')
-rw-r--r--usr.sbin/ripd/auth.c11
-rw-r--r--usr.sbin/ripd/message.c7
-rw-r--r--usr.sbin/ripd/rde.c9
3 files changed, 12 insertions, 15 deletions
diff --git a/usr.sbin/ripd/auth.c b/usr.sbin/ripd/auth.c
index 3f29bf8752f..871880f8648 100644
--- a/usr.sbin/ripd/auth.c
+++ b/usr.sbin/ripd/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.4 2006/11/27 15:02:34 stevesk Exp $ */
+/* $OpenBSD: auth.c,v 1.5 2007/03/31 09:49:20 michele Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -198,7 +198,7 @@ auth_gen(struct buf *buf, struct iface *iface)
switch (iface->auth_type) {
case AUTH_SIMPLE:
- return (buf_add(buf, &iface->auth_key, MAX_SIMPLE_AUTH_LEN));
+ buf_add(buf, &iface->auth_key, MAX_SIMPLE_AUTH_LEN);
break;
case AUTH_CRYPT:
if ((md = md_list_find(&iface->auth_md_list,
@@ -212,11 +212,12 @@ auth_gen(struct buf *buf, struct iface *iface)
a.auth_seq = htonl(auth_get_seq_num(md));
a.auth_length = MD5_DIGEST_LENGTH + AUTH_TRLR_HDR_LEN;
- return (buf_add(buf, &a, sizeof(a)));
+ buf_add(buf, &a, sizeof(a));
break;
default:
- /* NOTREACHED */
- break;
+ log_debug("auth_gen: unknown auth type, interface %s",
+ iface->name);
+ return (-1);
}
return (0);
diff --git a/usr.sbin/ripd/message.c b/usr.sbin/ripd/message.c
index 469ae34cee7..acc50e2fd3a 100644
--- a/usr.sbin/ripd/message.c
+++ b/usr.sbin/ripd/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.6 2006/11/11 15:55:52 michele Exp $ */
+/* $OpenBSD: message.c,v 1.7 2007/03/31 09:49:20 michele Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -37,6 +37,7 @@ extern struct ripd_conf *oeconf;
void delete_entry(struct rip_route *);
/* timers */
+/* ARGSUSED */
void
report_timer(int fd, short event, void *arg)
{
@@ -259,8 +260,10 @@ send_response(struct packet_head *r_list, struct iface *i, struct nbr *nbr)
nentries = 0;
if (iface->auth_type != AUTH_NONE) {
- if (auth_gen(buf, iface) < 0)
+ if (auth_gen(buf, iface) == -1) {
+ buf_free(buf);
return (-1);
+ }
nentries++;
}
diff --git a/usr.sbin/ripd/rde.c b/usr.sbin/ripd/rde.c
index c49b19faefc..22b93adaebe 100644
--- a/usr.sbin/ripd/rde.c
+++ b/usr.sbin/ripd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.4 2007/01/24 10:14:17 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.5 2007/03/31 09:49:20 michele Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -47,7 +47,6 @@ void rde_sig_handler(int, short, void *);
void rde_shutdown(void);
void rde_dispatch_imsg(int, short, void *);
void rde_dispatch_parent(int, short, void *);
-int rde_imsg_compose_parent(int, pid_t, void *, u_int16_t);
int rde_imsg_compose_ripe(int, u_int32_t, pid_t, void *, u_int16_t);
int rde_check_route(struct rip_route *);
void triggered_update(struct rt_node *);
@@ -172,12 +171,6 @@ rde_shutdown(void)
/* imesg */
int
-rde_imsg_compose_parent(int type, pid_t pid, void *data, u_int16_t datalen)
-{
- return (imsg_compose(ibuf_main, type, 0, pid, data, datalen));
-}
-
-int
rde_imsg_compose_ripe(int type, u_int32_t peerid, pid_t pid, void *data,
u_int16_t datalen)
{