mirror of
https://github.com/openvswitch/ovs
synced 2025-10-15 14:17:18 +00:00
Check invariants earlier in vconn and stream code.
These invariants are checked by vconn_open() and stream_open(), but there is no reason not to check them earlier also. vconn and stream creation don't have to go through vconn_open() and stream_open(), so this ensures that the invariants get checked either way.
This commit is contained in:
@@ -476,6 +476,7 @@ stream_init(struct stream *stream, struct stream_class *class,
|
|||||||
: SCS_DISCONNECTED);
|
: SCS_DISCONNECTED);
|
||||||
stream->error = connect_status;
|
stream->error = connect_status;
|
||||||
stream->name = xstrdup(name);
|
stream->name = xstrdup(name);
|
||||||
|
assert(stream->state != SCS_CONNECTING || class->connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -1444,6 +1444,7 @@ vconn_init(struct vconn *vconn, struct vconn_class *class, int connect_status,
|
|||||||
vconn->local_ip = 0;
|
vconn->local_ip = 0;
|
||||||
vconn->local_port = 0;
|
vconn->local_port = 0;
|
||||||
vconn->name = xstrdup(name);
|
vconn->name = xstrdup(name);
|
||||||
|
assert(vconn->state != VCS_CONNECTING || class->connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user