Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290511
b: refs/heads/master
c: b58343f
h: refs/heads/master
i:
  290509: 8973250
  290507: 83f8152
  290503: c9f2371
  290495: f59afb8
v: v3
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Feb 24, 2012
1 parent c63596d commit 29ef279
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 077a26f029e76a5918edf9c1d44d5566eec719fc
refs/heads/master: b58343f9ea75f02ef48b984767511c6b3ba76eaf
2 changes: 1 addition & 1 deletion trunk/net/tipc/bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/tipc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)");

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/tipc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

/* global variables used by multiple sub-systems within TIPC */

int tipc_mode;
int tipc_random;

const char tipc_alphabet[] =
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions trunk/net/tipc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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[];

Expand Down
7 changes: 1 addition & 6 deletions trunk/net/tipc/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/tipc/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 29ef279

Please sign in to comment.