X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=tests%2Ftest-sflow.c;h=3e3c45014f699f572fb7889a07da8d8edb475220;hb=6fd6ed7;hp=4f7940db96eee047ed6945f108ee626514f4423e;hpb=cf62fa4c7074121184a1f1d07980990113657612;p=cascardo%2Fovs.git diff --git a/tests/test-sflow.c b/tests/test-sflow.c index 4f7940db9..3e3c45014 100644 --- a/tests/test-sflow.c +++ b/tests/test-sflow.c @@ -607,13 +607,13 @@ static void print_sflow(struct ofpbuf *buf) { char *dgram_buf; - int dgram_len = ofpbuf_size(buf); + int dgram_len = buf->size; struct sflow_xdr xdrDatagram; struct sflow_xdr *x = &xdrDatagram; memset(x, 0, sizeof *x); if (SFLOWXDR_try(x)) { - SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf, ofpbuf_size(buf)))); + SFLOWXDR_assert(x, (dgram_buf = ofpbuf_try_pull(buf, buf->size))); sflowxdr_init(x, dgram_buf, dgram_len); SFLOWXDR_assert(x, dgram_len >= SFLOW_MIN_LEN); process_datagram(x); @@ -669,7 +669,7 @@ test_sflow_main(int argc, char *argv[]) ofpbuf_clear(&buf); do { - retval = recv(sock, ofpbuf_data(&buf), buf.allocated, 0); + retval = recv(sock, buf.data, buf.allocated, 0); } while (retval < 0 && errno == EINTR); if (retval > 0) { ofpbuf_put_uninit(&buf, retval);