On Thu, Jan 02, 2014 at 02:09:11PM -0800, Andy Zhou wrote:
> The dummy ports thus far only support passive connections. It can
> listen for multiple incoming connection requests but not make active
> connections. This patch adds support of active stream, so that a
> dummy port can be configured with either passive or active connections.
>
> The net result is that dummy ports can now connect to each other,
> without being patch ports. This feature will be useful in adding test
> cases of future commits.
>
> Signed-off-by: Andy Zhou <[email protected]>
I'm happy with this. Thank you.
Some of the indentation is not how we usually do it, for example this:
switch (reconnect_run(rconn->reconnect, time_msec())) {
case RECONNECT_CONNECT: {
int err = stream_connect(rconn->rstream->stream);
switch (err) {
case 0: /* Connected. */
reconnect_connected(rconn->reconnect, time_msec());
dev->conn.type = ACTIVE;
break;
case EAGAIN:
reconnect_connecting(rconn->reconnect, time_msec());
return;
default:
reconnect_connect_failed(rconn->reconnect,
time_msec(), err);
stream_close(rconn->rstream->stream);
return;
}
}
break;
case RECONNECT_DISCONNECT:
case RECONNECT_PROBE:
default:
break;
}
I would ordinarily indent as:
switch (reconnect_run(rconn->reconnect, time_msec())) {
case RECONNECT_CONNECT: {
int err = stream_connect(rconn->rstream->stream);
switch (err) {
case 0: /* Connected. */
reconnect_connected(rconn->reconnect, time_msec());
dev->conn.type = ACTIVE;
break;
case EAGAIN:
reconnect_connecting(rconn->reconnect, time_msec());
return;
default:
reconnect_connect_failed(rconn->reconnect,
time_msec(), err);
stream_close(rconn->rstream->stream);
return;
}
break;
}
case RECONNECT_DISCONNECT:
case RECONNECT_PROBE:
default:
break;
}
(even though the two }s at the same level are confusing, it's how
we've being doing it) and similarly for the other switch statements.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev