aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/config.c7
-rw-r--r--net/tipc/core.c10
-rw-r--r--net/tipc/core.h2
3 files changed, 4 insertions, 15 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 69cca4f67e8e..7ca3854a2ac8 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -252,11 +252,8 @@ static struct sk_buff *cfg_set_max_ports(void)
252 if (value < 127 || value > 65535) 252 if (value < 127 || value > 65535)
253 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE 253 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
254 " (max ports must be 127-65535)"); 254 " (max ports must be 127-65535)");
255 if (tipc_mode != TIPC_NOT_RUNNING) 255 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
256 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 256 " (cannot change max ports while TIPC is active)");
257 " (cannot change max ports while TIPC is active)");
258 tipc_max_ports = value;
259 return tipc_cfg_reply_none();
260} 257}
261 258
262static struct sk_buff *cfg_set_netid(void) 259static struct sk_buff *cfg_set_netid(void)
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 2691cd57b8a8..ec381d444bc3 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -53,7 +53,7 @@
53 53
54/* global variables used by multiple sub-systems within TIPC */ 54/* global variables used by multiple sub-systems within TIPC */
55 55
56int tipc_mode = TIPC_NOT_RUNNING; 56int tipc_mode;
57int tipc_random; 57int tipc_random;
58 58
59const char tipc_alphabet[] = 59const char tipc_alphabet[] =
@@ -125,11 +125,6 @@ int tipc_core_start_net(unsigned long addr)
125 125
126static void tipc_core_stop(void) 126static void tipc_core_stop(void)
127{ 127{
128 if (tipc_mode != TIPC_NODE_MODE)
129 return;
130
131 tipc_mode = TIPC_NOT_RUNNING;
132
133 tipc_netlink_stop(); 128 tipc_netlink_stop();
134 tipc_handler_stop(); 129 tipc_handler_stop();
135 tipc_cfg_stop(); 130 tipc_cfg_stop();
@@ -148,9 +143,6 @@ static int tipc_core_start(void)
148{ 143{
149 int res; 144 int res;
150 145
151 if (tipc_mode != TIPC_NOT_RUNNING)
152 return -ENOPROTOOPT;
153
154 get_random_bytes(&tipc_random, sizeof(tipc_random)); 146 get_random_bytes(&tipc_random, sizeof(tipc_random));
155 tipc_mode = TIPC_NODE_MODE; 147 tipc_mode = TIPC_NODE_MODE;
156 148
diff --git a/net/tipc/core.h b/net/tipc/core.h
index aefe1869572e..9842ec08dd5c 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -132,7 +132,7 @@ void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *);
132/* 132/*
133 * TIPC operating mode routines 133 * TIPC operating mode routines
134 */ 134 */
135#define TIPC_NOT_RUNNING 0 135
136#define TIPC_NODE_MODE 1 136#define TIPC_NODE_MODE 1
137#define TIPC_NET_MODE 2 137#define TIPC_NET_MODE 2
138 138