Date: Sun, 5 Apr 2009 16:01:56 +0000 (UTC) From: Poul-Henning Kamp <phk@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r190716 - head/sbin/routed Message-ID: <200904051601.n35G1uME022999@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: phk Date: Sun Apr 5 16:01:56 2009 New Revision: 190716 URL: http://svn.freebsd.org/changeset/base/190716 Log: Some constifications Modified: head/sbin/routed/defs.h head/sbin/routed/main.c head/sbin/routed/rdisc.c Modified: head/sbin/routed/defs.h ============================================================================== --- head/sbin/routed/defs.h Sun Apr 5 15:55:09 2009 (r190715) +++ head/sbin/routed/defs.h Sun Apr 5 16:01:56 2009 (r190716) @@ -450,7 +450,7 @@ extern naddr myaddr; /* main address o 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 */ Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sun Apr 5 15:55:09 2009 (r190715) +++ head/sbin/routed/main.c Sun Apr 5 16:01:56 2009 (r190716) @@ -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; Modified: head/sbin/routed/rdisc.c ============================================================================== --- head/sbin/routed/rdisc.c Sun Apr 5 15:55:09 2009 (r190715) +++ head/sbin/routed/rdisc.c Sun Apr 5 16:01:56 2009 (r190716) @@ -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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904051601.n35G1uME022999>