aboutsummaryrefslogtreecommitdiff
path: root/sbin/routed
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2009-04-05 16:01:56 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2009-04-05 16:01:56 +0000
commit49694c6d53cf072d58890195fa434a75c4f51a89 (patch)
tree4c8275987bf66353f2d9c22a35560006425d9f6f /sbin/routed
parentf2ca6d8a9023eeb15f103c9266f3e13c074ec9bb (diff)
downloadsrc-49694c6d53cf072d58890195fa434a75c4f51a89.tar.gz
src-49694c6d53cf072d58890195fa434a75c4f51a89.zip
Some constifications
Notes
Notes: svn path=/head/; revision=190716
Diffstat (limited to 'sbin/routed')
-rw-r--r--sbin/routed/defs.h2
-rw-r--r--sbin/routed/main.c2
-rw-r--r--sbin/routed/rdisc.c8
3 files changed, 7 insertions, 5 deletions
diff --git a/sbin/routed/defs.h b/sbin/routed/defs.h
index 5e72e3cf13eb..16a7b328eccd 100644
--- a/sbin/routed/defs.h
+++ b/sbin/routed/defs.h
@@ -450,7 +450,7 @@ extern naddr myaddr; /* main address of this system */
extern int stopint; /* !=0 to stop */
extern int rip_sock; /* RIP socket */
-extern struct interface *rip_sock_mcast; /* current multicast interface */
+extern const struct interface *rip_sock_mcast; /* current multicast interface */
extern int rt_sock; /* routing socket */
extern int rt_sock_seqno;
extern int rdisc_sock; /* router-discovery raw socket */
diff --git a/sbin/routed/main.c b/sbin/routed/main.c
index fd01d8e0e0e2..85bc9e8d3675 100644
--- a/sbin/routed/main.c
+++ b/sbin/routed/main.c
@@ -88,7 +88,7 @@ static struct timeval flush_kern_timer;
static fd_set fdbits;
static int sock_max;
int rip_sock = -1; /* RIP socket */
-struct interface *rip_sock_mcast; /* current multicast interface */
+const struct interface *rip_sock_mcast; /* current multicast interface */
int rt_sock; /* routing socket */
int rt_sock_seqno;
diff --git a/sbin/routed/rdisc.c b/sbin/routed/rdisc.c
index be160a829249..262b251e1b33 100644
--- a/sbin/routed/rdisc.c
+++ b/sbin/routed/rdisc.c
@@ -73,21 +73,23 @@ union ad_u {
int rdisc_sock = -1; /* router-discovery raw socket */
-static struct interface *rdisc_sock_mcast; /* current multicast interface */
+static const struct interface *rdisc_sock_mcast; /* current multicast interface */
struct timeval rdisc_timer;
int rdisc_ok; /* using solicited route */
#define MAX_ADS 16 /* at least one per interface */
-static struct dr { /* accumulated advertisements */
+struct dr { /* accumulated advertisements */
struct interface *dr_ifp;
naddr dr_gate; /* gateway */
time_t dr_ts; /* when received */
time_t dr_life; /* lifetime in host byte order */
n_long dr_recv_pref; /* received but biased preference */
n_long dr_pref; /* preference adjusted by metric */
-} *cur_drp, drs[MAX_ADS];
+};
+static const struct dr *cur_drp;
+static struct dr drs[MAX_ADS];
/* convert between signed, balanced around zero,
* and unsigned zero-based preferences */