Comments
Patch
@@ -54,7 +54,8 @@ u32 tipc_get_addr(void);
#define TIPC_NOT_RUNNING 0
#define TIPC_NODE_MODE 1
-#define TIPC_NET_MODE 2
+#define TIPC_TRANS_MODE 2
+#define TIPC_NET_MODE 3
typedef void (*tipc_mode_event)(void *usr_handle, int mode, u32 addr);
@@ -278,7 +278,7 @@ int tipc_net_start(u32 addr)
tipc_cfg_stop();
tipc_own_addr = addr;
- tipc_mode = TIPC_NET_MODE;
+ tipc_mode = TIPC_TRANS_MODE;
tipc_named_reinit();
tipc_port_reinit();
@@ -295,18 +295,20 @@ int tipc_net_start(u32 addr)
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);
+ tipc_mode = TIPC_NET_MODE;
return 0;
}
void tipc_net_stop(void)
{
- if (tipc_mode != TIPC_NET_MODE)
+ if (tipc_mode < TIPC_TRANS_MODE)
return;
+ tipc_mode = TIPC_TRANS_MODE;
write_lock_bh(&tipc_net_lock);
tipc_bearer_stop();
- tipc_mode = TIPC_NODE_MODE;
tipc_bclink_stop();
net_stop();
+ tipc_mode = TIPC_NODE_MODE;
write_unlock_bh(&tipc_net_lock);
info("Left network mode \n");
}
As noted in my previous note, I'd agreed tht the preiviously posted patches for the various tipc patches we encountered were sufficient for the oops at hand. This patch closes the race condition thats left open after the application of those patches. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> include/net/tipc/tipc.h | 3 ++- net/tipc/net.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html