Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102614
b: refs/heads/master
c: 0319437
h: refs/heads/master
v: v3
  • Loading branch information
Allan Stephens authored and David S. Miller committed May 21, 2008
1 parent 8310a4f commit cb1e343
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 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: 6d4a6672c8263f98544d2b91690dc7074b144090
refs/heads/master: 03194379a77b02df3404ec4848a50c6784e9a8a5
3 changes: 1 addition & 2 deletions trunk/net/tipc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ static struct sk_buff *cfg_set_own_addr(void)
if (tipc_mode == TIPC_NET_MODE)
return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
" (cannot change node address once assigned)");
tipc_own_addr = addr;

/*
* Must release all spinlocks before calling start_net() because
Expand All @@ -306,7 +305,7 @@ static struct sk_buff *cfg_set_own_addr(void)
*/

spin_unlock_bh(&config_lock);
tipc_core_start_net();
tipc_core_start_net(addr);
spin_lock_bh(&config_lock);
return tipc_cfg_reply_none();
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/tipc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ void tipc_core_stop_net(void)
* start_net - start TIPC networking sub-systems
*/

int tipc_core_start_net(void)
int tipc_core_start_net(unsigned long addr)
{
int res;

if ((res = tipc_net_start()) ||
if ((res = tipc_net_start(addr)) ||
(res = tipc_eth_media_start())) {
tipc_core_stop_net();
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/tipc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ extern atomic_t tipc_user_count;

extern int tipc_core_start(void);
extern void tipc_core_stop(void);
extern int tipc_core_start_net(void);
extern int tipc_core_start_net(unsigned long addr);
extern void tipc_core_stop_net(void);
extern int tipc_handler_start(void);
extern void tipc_handler_stop(void);
Expand Down
10 changes: 7 additions & 3 deletions trunk/net/tipc/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,18 @@ void tipc_net_route_msg(struct sk_buff *buf)
tipc_link_send(buf, dnode, msg_link_selector(msg));
}

int tipc_net_start(void)
int tipc_net_start(u32 addr)
{
char addr_string[16];
int res;

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 @@ -284,10 +288,10 @@ int tipc_net_start(void)
(res = tipc_bclink_init())) {
return res;
}
tipc_subscr_stop();
tipc_cfg_stop();

tipc_k_signal((Handler)tipc_subscr_start, 0);
tipc_k_signal((Handler)tipc_cfg_init, 0);

info("Started in network mode\n");
info("Own node address %s, network identity %u\n",
addr_string_fill(addr_string, tipc_own_addr), tipc_net_id);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/tipc/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void tipc_net_route_msg(struct sk_buff *buf);
struct node *tipc_net_select_remote_node(u32 addr, u32 ref);
u32 tipc_net_select_router(u32 addr, u32 ref);

int tipc_net_start(void);
int tipc_net_start(u32 addr);
void tipc_net_stop(void);

#endif

0 comments on commit cb1e343

Please sign in to comment.