diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 5f5e89e12fcf8290cb42393e4d61ebf1164cb87f..5dfd89c404293c7fd1f6e6cd39be15f70c650d90 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -435,7 +435,7 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) u32 i; int res = -EINVAL; - if (tipc_mode != TIPC_NET_MODE) { + if (!tipc_own_addr) { warn("Bearer <%s> rejected, not supported in standalone mode\n", name); return -ENOPROTOOPT; diff --git a/net/tipc/config.c b/net/tipc/config.c index 7ca3854a2ac8c62a5ee34df16d4a3b277a20e7ee..f76d3b15e4e20ab6baaab45e68cf44d5badecf3f 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c @@ -179,7 +179,7 @@ static struct sk_buff *cfg_set_own_addr(void) if (!tipc_addr_node_valid(addr)) return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE " (node address)"); - if (tipc_mode == TIPC_NET_MODE) + if (tipc_own_addr) return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED " (cannot change node address once assigned)"); @@ -268,7 +268,7 @@ static struct sk_buff *cfg_set_netid(void) if (value < 1 || value > 9999) return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE " (network id must be 1-9999)"); - if (tipc_mode == TIPC_NET_MODE) + if (tipc_own_addr) return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED " (cannot change network id once TIPC has joined a network)"); tipc_net_id = value; diff --git a/net/tipc/core.c b/net/tipc/core.c index ec381d444bc3651da5019407caa2f553e9bc763d..68eba03e7955875e48f829f04fd1fbe202690d38 100644 --- a/net/tipc/core.c +++ b/net/tipc/core.c @@ -53,7 +53,6 @@ /* global variables used by multiple sub-systems within TIPC */ -int tipc_mode; int tipc_random; const char tipc_alphabet[] = @@ -144,7 +143,6 @@ static int tipc_core_start(void) int res; get_random_bytes(&tipc_random, sizeof(tipc_random)); - tipc_mode = TIPC_NODE_MODE; res = tipc_handler_start(); if (!res) diff --git a/net/tipc/core.h b/net/tipc/core.h index 9842ec08dd5cd210bf937bbbbf4f95e8404ccd6c..13837e0e56b13267e047a8d4cbc581c5475129f8 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h @@ -129,13 +129,6 @@ void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *); #define ELINKCONG EAGAIN /* link congestion <=> resource unavailable */ -/* - * TIPC operating mode routines - */ - -#define TIPC_NODE_MODE 1 -#define TIPC_NET_MODE 2 - /* * Global configuration variables */ @@ -151,7 +144,6 @@ extern int tipc_remote_management; * Other global variables */ -extern int tipc_mode; extern int tipc_random; extern const char tipc_alphabet[]; diff --git a/net/tipc/net.c b/net/tipc/net.c index 2abd4be4933e2983f98f813e41231f62faf421f7..d4531b07076cc933cc646cbbf15adfc7c728cf67 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -175,14 +175,10 @@ int tipc_net_start(u32 addr) { char addr_string[16]; - if (tipc_mode != TIPC_NODE_MODE) - return -ENOPROTOOPT; - tipc_subscr_stop(); tipc_cfg_stop(); tipc_own_addr = addr; - tipc_mode = TIPC_NET_MODE; tipc_named_reinit(); tipc_port_reinit(); @@ -201,10 +197,9 @@ void tipc_net_stop(void) { struct tipc_node *node, *t_node; - if (tipc_mode != TIPC_NET_MODE) + if (!tipc_own_addr) return; write_lock_bh(&tipc_net_lock); - tipc_mode = TIPC_NODE_MODE; tipc_bearer_stop(); tipc_bclink_stop(); list_for_each_entry_safe(node, t_node, &tipc_node_list, list) diff --git a/net/tipc/node.c b/net/tipc/node.c index 12ddc658157297df572b63047f0546f01ddeddab..a34cabc2c43a48d3ef2250f57bda634a0fc4db9c 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -406,7 +406,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space) return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE " (network address)"); - if (tipc_mode != TIPC_NET_MODE) + if (!tipc_own_addr) return tipc_cfg_reply_none(); read_lock_bh(&tipc_net_lock);