summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2007-10-24 20:38:03 +0000
committerclaudio <claudio@openbsd.org>2007-10-24 20:38:03 +0000
commit1d57a832d9347ff4d02ea7787324c8f3dd7ea1d8 (patch)
treef31414fbfcdf8c74f43a4f29484427e1e36edb38
parentAn u_int8_t is enough as prefixlen. Another lint warning gone. (diff)
downloadwireguard-openbsd-1d57a832d9347ff4d02ea7787324c8f3dd7ea1d8.tar.xz
wireguard-openbsd-1d57a832d9347ff4d02ea7787324c8f3dd7ea1d8.zip
The metric is a 8bit value ranging from 1 to INFINITY (defined as a whopping
16). So use u_int8_t everywhere.
-rw-r--r--usr.sbin/ripd/rde.c4
-rw-r--r--usr.sbin/ripd/rde.h4
-rw-r--r--usr.sbin/ripd/rde_rib.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ripd/rde.c b/usr.sbin/ripd/rde.c
index 1f98731b106..a2614496c9d 100644
--- a/usr.sbin/ripd/rde.c
+++ b/usr.sbin/ripd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.8 2007/10/24 19:05:06 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.9 2007/10/24 20:38:03 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -401,7 +401,7 @@ rde_check_route(struct rip_route *e)
struct timeval tv, now;
struct rt_node *rn;
struct iface *iface;
- int metric;
+ u_int8_t metric;
if ((e->nexthop.s_addr & htonl(IN_CLASSA_NET)) ==
htonl(INADDR_LOOPBACK & IN_CLASSA_NET) ||
diff --git a/usr.sbin/ripd/rde.h b/usr.sbin/ripd/rde.h
index 13c4db63f34..65dbf3fdcca 100644
--- a/usr.sbin/ripd/rde.h
+++ b/usr.sbin/ripd/rde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.h,v 1.3 2007/10/18 17:00:59 deraadt Exp $ */
+/* $OpenBSD: rde.h,v 1.4 2007/10/24 20:38:03 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -51,7 +51,7 @@ void rt_init(void);
int rt_compare(struct rt_node *, struct rt_node *);
struct rt_node *rt_find(in_addr_t, in_addr_t);
struct rt_node *rt_new_kr(struct kroute *);
-struct rt_node *rt_new_rr(struct rip_route *, int);
+struct rt_node *rt_new_rr(struct rip_route *, u_int8_t);
int rt_insert(struct rt_node *);
int rt_remove(struct rt_node *);
void rt_complete(struct rip_route *);
diff --git a/usr.sbin/ripd/rde_rib.c b/usr.sbin/ripd/rde_rib.c
index a2ad9e88493..96ed32efcb1 100644
--- a/usr.sbin/ripd/rde_rib.c
+++ b/usr.sbin/ripd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.4 2007/10/24 11:47:59 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.5 2007/10/24 20:38:03 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -167,7 +167,7 @@ rt_new_kr(struct kroute *kr)
}
struct rt_node *
-rt_new_rr(struct rip_route *e, int metric)
+rt_new_rr(struct rip_route *e, u_int8_t metric)
{
struct rt_node *rn;