aboutsummaryrefslogtreecommitdiff
path: root/lib/jsonrpc.c
diff options
context:
space:
mode:
authorMehak Mahajan <mmahajan@nicira.com>2012-06-21 12:22:42 -0700
committerMehak Mahajan <mmahajan@nicira.com>2012-06-21 12:22:42 -0700
commit0442efd9b1a88d923b56eab6b72b6be8231a49f7 (patch)
tree33698e4fa4e975179fe58852ad6e974e91f5c17c /lib/jsonrpc.c
parentbed69b3e61de1728e731bcefca2370de52c30d14 (diff)
Reapplying the dscp changes: No need to restart DB/OVS on changing dscp value.
This patch reapplies the changes that were reverted with the commit 59efa47 (Revert DSCP update changes.). It also addresses the problem introduced by the original commits, cd8fca2 ((jsonrpc: Correctly setting the dscp value before reconnect.) and b2e18d (No need to restart DB / OVS on changing dscp value.), that caused numerous unit test failures on some systems (as diagnosed by valgrind). With this change there is no need to restart the DB or OVS on configuring a different value for the manager or controller connection respectively. On detecting a change in the dscp value on the socket, the previous socket is closed and a new socket is created and connection is established with the new configured dscp value. Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Diffstat (limited to 'lib/jsonrpc.c')
-rw-r--r--lib/jsonrpc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index 5c3359cb..57613697 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -793,6 +793,7 @@ jsonrpc_session_open_unreliably(struct jsonrpc *jsonrpc)
reconnect_set_name(s->reconnect, jsonrpc_get_name(jsonrpc));
reconnect_set_max_tries(s->reconnect, 0);
reconnect_connected(s->reconnect, time_msec());
+ s->dscp = 0;
s->rpc = jsonrpc;
s->stream = NULL;
s->pstream = NULL;
@@ -1058,5 +1059,8 @@ void
jsonrpc_session_set_dscp(struct jsonrpc_session *s,
uint8_t dscp)
{
- s->dscp = dscp;
+ if (s->dscp != dscp) {
+ s->dscp = dscp;
+ jsonrpc_session_force_reconnect(s);
+ }
}