X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fvconn-stream.c;h=613b92cfbbca009f8bd6c3b670221eb35960194b;hb=ea7655d9f9d38a3af7250de8ba0b89115b5f4a5e;hp=d707e063c302364bd33305e8946b9c9881ee90e9;hpb=e368cad8ecf6dbf272b2a3775b2e3e5e2dc6a5cf;p=sliver-openvswitch.git diff --git a/lib/vconn-stream.c b/lib/vconn-stream.c index d707e063c..613b92cfb 100644 --- a/lib/vconn-stream.c +++ b/lib/vconn-stream.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -54,13 +53,14 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 25); static void vconn_stream_clear_txbuf(struct vconn_stream *); static struct vconn * -vconn_stream_new(struct stream *stream, int connect_status) +vconn_stream_new(struct stream *stream, int connect_status, + uint32_t allowed_versions) { struct vconn_stream *s; s = xmalloc(sizeof *s); vconn_init(&s->vconn, &stream_vconn_class, connect_status, - stream_get_name(stream)); + stream_get_name(stream), allowed_versions); s->stream = stream; s->txbuf = NULL; s->rxbuf = NULL; @@ -77,8 +77,8 @@ vconn_stream_new(struct stream *stream, int connect_status) * * Returns 0 if successful, otherwise a positive errno value. */ static int -vconn_stream_open(const char *name, char *suffix OVS_UNUSED, - struct vconn **vconnp, uint8_t dscp) +vconn_stream_open(const char *name, uint32_t allowed_versions, + char *suffix OVS_UNUSED, struct vconn **vconnp, uint8_t dscp) { struct stream *stream; int error; @@ -88,7 +88,7 @@ vconn_stream_open(const char *name, char *suffix OVS_UNUSED, if (!error) { error = stream_connect(stream); if (!error || error == EAGAIN) { - *vconnp = vconn_stream_new(stream, error); + *vconnp = vconn_stream_new(stream, error, allowed_versions); return 0; } } @@ -310,8 +310,9 @@ pvconn_pstream_cast(struct pvconn *pvconn) * Returns 0 if successful, otherwise a positive errno value. (The current * implementation never fails.) */ static int -pvconn_pstream_listen(const char *name, char *suffix OVS_UNUSED, - struct pvconn **pvconnp, uint8_t dscp) +pvconn_pstream_listen(const char *name, uint32_t allowed_versions, + char *suffix OVS_UNUSED, struct pvconn **pvconnp, + uint8_t dscp) { struct pvconn_pstream *ps; struct pstream *pstream; @@ -324,7 +325,7 @@ pvconn_pstream_listen(const char *name, char *suffix OVS_UNUSED, } ps = xmalloc(sizeof *ps); - pvconn_init(&ps->pvconn, &pstream_pvconn_class, name); + pvconn_init(&ps->pvconn, &pstream_pvconn_class, name, allowed_versions); ps->pstream = pstream; *pvconnp = &ps->pvconn; return 0; @@ -354,7 +355,7 @@ pvconn_pstream_accept(struct pvconn *pvconn, struct vconn **new_vconnp) return error; } - *new_vconnp = vconn_stream_new(stream, 0); + *new_vconnp = vconn_stream_new(stream, 0, pvconn->allowed_versions); return 0; }