diff options
author | Ciprian Barbu <ciprian.barbu@linaro.org> | 2015-02-03 18:59:49 +0000 |
---|---|---|
committer | Zoltan Kiss <zoltan.kiss@linaro.org> | 2015-02-03 18:59:49 +0000 |
commit | 5653dd4c29aab9771fa9652dc5c8bca8fb8cc1e2 (patch) | |
tree | 10b850f7dfd667fe88643e38e1eface9ee36c565 | |
parent | 78cdc48a6eb40a4ca6a8d1f49188f056365ab0bc (diff) |
ofpbuf: init the buffer source before any other operations
The source was not initialized before calling ofpbuf_init__, which is needed by
the ODP netdev implementation.
Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
-rw-r--r-- | lib/ofpbuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index 764a7990e..6f27b47cd 100644 --- a/lib/ofpbuf.c +++ b/lib/ofpbuf.c @@ -38,11 +38,11 @@ static void ofpbuf_use__(struct ofpbuf *b, void *base, size_t allocated, enum ofpbuf_source source) { + ofpbuf_init__(b, allocated, source); + ofpbuf_set_base(b, base); ofpbuf_set_data(b, base); ofpbuf_set_size(b, 0); - - ofpbuf_init__(b, allocated, source); } /* Initializes 'b' as an empty ofpbuf that contains the 'allocated' bytes of |