aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiprian Barbu <ciprian.barbu@linaro.org>2015-02-03 18:59:49 +0000
committerZoltan Kiss <zoltan.kiss@linaro.org>2015-02-03 18:59:49 +0000
commit5653dd4c29aab9771fa9652dc5c8bca8fb8cc1e2 (patch)
tree10b850f7dfd667fe88643e38e1eface9ee36c565
parent78cdc48a6eb40a4ca6a8d1f49188f056365ab0bc (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.c4
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