diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-10-13 20:37:15 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-10-13 20:37:15 +0200 |
commit | 79159516d6c685949e5d6a3269f718d730a338cf (patch) | |
tree | 13fd8e90ea89267044da49fdbbe2db45a56fc970 /lib/smux.c | |
parent | Fix for IPv6 OSPF BFD session staying down when ifdown/ifup on logical interf... (diff) | |
download | frr-79159516d6c685949e5d6a3269f718d730a338cf.tar.xz frr-79159516d6c685949e5d6a3269f718d730a338cf.zip |
lib: fix vty.c and smux.c static variable clash
Both vty.c and smux.c declare:
static struct thread_master *master
This is not a good thing because they are both linked into
the same library. If you want to pass different struct thread_master
pointers into smux.c and vty.c you will probably not get the result
you were looking for
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/smux.c')
-rw-r--r-- | lib/smux.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/smux.c b/lib/smux.c index 70be49289..5012e8d95 100644 --- a/lib/smux.c +++ b/lib/smux.c @@ -113,7 +113,7 @@ static struct cmd_node smux_node = }; /* thread master */ -static struct thread_master *master; +static struct thread_master *smux_master; static int oid_compare_part (oid *o1, int o1_len, oid *o2, int o2_len) @@ -1239,13 +1239,13 @@ smux_event (enum smux_event event, int sock) switch (event) { case SMUX_SCHEDULE: - smux_connect_thread = thread_add_event (master, smux_connect, NULL, 0); + smux_connect_thread = thread_add_event (smux_master, smux_connect, NULL, 0); break; case SMUX_CONNECT: - smux_connect_thread = thread_add_timer (master, smux_connect, NULL, 10); + smux_connect_thread = thread_add_timer (smux_master, smux_connect, NULL, 10); break; case SMUX_READ: - smux_read_thread = thread_add_read (master, smux_read, NULL, sock); + smux_read_thread = thread_add_read (smux_master, smux_read, NULL, sock); break; default: break; @@ -1473,8 +1473,9 @@ smux_tree_cmp(struct subtree *tree1, struct subtree *tree2) void smux_init (struct thread_master *tm) { + assert (tm); /* copy callers thread master */ - master = tm; + smux_master = tm; /* Make MIB tree. */ treelist = list_new(); |