diff options
author | Ethan Jackson <ethan@nicira.com> | 2012-04-11 19:52:46 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2012-04-17 13:03:11 -0700 |
commit | 317f6420764f9024deead76fc98477327a8a180e (patch) | |
tree | 52d9dd0432ef0d6b6b70aaa56fdd65baf32e3b59 /lib/jsonrpc.c | |
parent | a4efa3fc5dffb8c5011ac889aae83fb5e38fbd85 (diff) |
lib: Pull dscp bits out of reconnect.
The DSCP bits of a connection have nothing to do with the
reconnection state machine. This pulls them up into jsonrpc which
needs them to properly establish connections.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/jsonrpc.c')
-rw-r--r-- | lib/jsonrpc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c index e95db8af..fc8a75b0 100644 --- a/lib/jsonrpc.c +++ b/lib/jsonrpc.c @@ -734,6 +734,7 @@ struct jsonrpc_session { struct stream *stream; struct pstream *pstream; unsigned int seqno; + uint8_t dscp; }; /* Creates and returns a jsonrpc_session to 'name', which should be a string @@ -759,6 +760,7 @@ jsonrpc_session_open(const char *name) s->stream = NULL; s->pstream = NULL; s->seqno = 0; + s->dscp = 0; if (!pstream_verify_name(name)) { reconnect_set_passive(s->reconnect, true, time_msec()); @@ -830,14 +832,13 @@ jsonrpc_session_connect(struct jsonrpc_session *s) jsonrpc_session_disconnect(s); if (!reconnect_is_passive(s->reconnect)) { - error = jsonrpc_stream_open(name, &s->stream, - reconnect_get_dscp(s->reconnect)); + error = jsonrpc_stream_open(name, &s->stream, s->dscp); if (!error) { reconnect_connecting(s->reconnect, time_msec()); } } else { error = s->pstream ? 0 : jsonrpc_pstream_open(name, &s->pstream, - reconnect_get_dscp(s->reconnect)); + s->dscp); if (!error) { reconnect_listening(s->reconnect, time_msec()); } @@ -1053,5 +1054,5 @@ void jsonrpc_session_set_dscp(struct jsonrpc_session *s, uint8_t dscp) { - reconnect_set_dscp(s->reconnect, dscp); + s->dscp = dscp; } |