Re: bgpd: fix last few common symbols

2020-11-05 Thread Brent Cook
ok bcook@

On Thu, Nov 5, 2020 at 6:16 AM Claudio Jeker  wrote:
>
> Since newer compilers default to -fno-common fix bgpd to not depend on
> common symbols. The last few ones can just be converted to static symbols
> since these are only used in the RDE or SE main code.
> With the previous diffs and this one I can compile bgpd and bgpctl with
> -fno-common.
>
> OK?
> --
> :wq Claudio
>
> ? obj
> Index: rde.c
> ===
> RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
> retrieving revision 1.505
> diff -u -p -r1.505 rde.c
> --- rde.c   5 Nov 2020 11:52:59 -   1.505
> +++ rde.c   5 Nov 2020 12:05:59 -
> @@ -98,12 +98,13 @@ static void  network_flush_upcall(struct
>  voidrde_shutdown(void);
>  int ovs_match(struct prefix *, u_int32_t);
>
> +static struct imsgbuf  *ibuf_se;
> +static struct imsgbuf  *ibuf_se_ctl;
> +static struct imsgbuf  *ibuf_main;
> +static struct bgpd_config  *conf, *nconf;
> +
>  volatile sig_atomic_t   rde_quit = 0;
> -struct bgpd_config *conf, *nconf;
>  struct filter_head *out_rules, *out_rules_tmp;
> -struct imsgbuf *ibuf_se;
> -struct imsgbuf *ibuf_se_ctl;
> -struct imsgbuf *ibuf_main;
>  struct rde_memstats rdemem;
>  int softreconfig;
>
> Index: session.c
> ===
> RCS file: /cvs/src/usr.sbin/bgpd/session.c,v
> retrieving revision 1.404
> diff -u -p -r1.404 session.c
> --- session.c   5 Nov 2020 11:52:59 -   1.404
> +++ session.c   5 Nov 2020 12:05:59 -
> @@ -100,15 +100,16 @@ void   session_template_clone(struct pee
> u_int32_t, u_int32_t);
>  int session_match_mask(struct peer *, struct bgpd_addr *);
>
> -struct bgpd_config *conf, *nconf;
> +static struct bgpd_config  *conf, *nconf;
> +static struct imsgbuf  *ibuf_rde;
> +static struct imsgbuf  *ibuf_rde_ctl;
> +static struct imsgbuf  *ibuf_main;
> +
>  struct bgpd_sysdep  sysdep;
>  volatile sig_atomic_t   session_quit;
>  int pending_reconf;
>  int csock = -1, rcsock = -1;
>  u_int   peer_cnt;
> -struct imsgbuf *ibuf_rde;
> -struct imsgbuf *ibuf_rde_ctl;
> -struct imsgbuf *ibuf_main;
>
>  struct mrt_head mrthead;
>  time_t  pauseaccept;
>



bgpd: fix last few common symbols

2020-11-05 Thread Claudio Jeker
Since newer compilers default to -fno-common fix bgpd to not depend on
common symbols. The last few ones can just be converted to static symbols
since these are only used in the RDE or SE main code.
With the previous diffs and this one I can compile bgpd and bgpctl with
-fno-common.

OK?
-- 
:wq Claudio

? obj
Index: rde.c
===
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
retrieving revision 1.505
diff -u -p -r1.505 rde.c
--- rde.c   5 Nov 2020 11:52:59 -   1.505
+++ rde.c   5 Nov 2020 12:05:59 -
@@ -98,12 +98,13 @@ static void  network_flush_upcall(struct
 voidrde_shutdown(void);
 int ovs_match(struct prefix *, u_int32_t);
 
+static struct imsgbuf  *ibuf_se;
+static struct imsgbuf  *ibuf_se_ctl;
+static struct imsgbuf  *ibuf_main;
+static struct bgpd_config  *conf, *nconf;
+
 volatile sig_atomic_t   rde_quit = 0;
-struct bgpd_config *conf, *nconf;
 struct filter_head *out_rules, *out_rules_tmp;
-struct imsgbuf *ibuf_se;
-struct imsgbuf *ibuf_se_ctl;
-struct imsgbuf *ibuf_main;
 struct rde_memstats rdemem;
 int softreconfig;
 
Index: session.c
===
RCS file: /cvs/src/usr.sbin/bgpd/session.c,v
retrieving revision 1.404
diff -u -p -r1.404 session.c
--- session.c   5 Nov 2020 11:52:59 -   1.404
+++ session.c   5 Nov 2020 12:05:59 -
@@ -100,15 +100,16 @@ void   session_template_clone(struct pee
u_int32_t, u_int32_t);
 int session_match_mask(struct peer *, struct bgpd_addr *);
 
-struct bgpd_config *conf, *nconf;
+static struct bgpd_config  *conf, *nconf;
+static struct imsgbuf  *ibuf_rde;
+static struct imsgbuf  *ibuf_rde_ctl;
+static struct imsgbuf  *ibuf_main;
+
 struct bgpd_sysdep  sysdep;
 volatile sig_atomic_t   session_quit;
 int pending_reconf;
 int csock = -1, rcsock = -1;
 u_int   peer_cnt;
-struct imsgbuf *ibuf_rde;
-struct imsgbuf *ibuf_rde_ctl;
-struct imsgbuf *ibuf_main;
 
 struct mrt_head mrthead;
 time_t  pauseaccept;