X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fcollectors.c;fp=ofproto%2Fcollectors.c;h=374fa8ca8b9b872e243f5abf6391b62b86726cec;hb=d7676fc647aa195912bfa3c92acffda371d1e06d;hp=f7cb1dbe4f23a5e791e23d63e134d5e6018ab07f;hpb=9f0100c2027bb702502f50988994ad887757b3ae;p=sliver-openvswitch.git diff --git a/ofproto/collectors.c b/ofproto/collectors.c index f7cb1dbe4..374fa8ca8 100644 --- a/ofproto/collectors.c +++ b/ofproto/collectors.c @@ -111,13 +111,15 @@ collectors_destroy(struct collectors *c) void collectors_send(const struct collectors *c, const void *payload, size_t n) { - size_t i; + if (c) { + size_t i; - for (i = 0; i < c->n_fds; i++) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); - if (send(c->fds[i], payload, n, 0) == -1) { - VLOG_WARN_RL(&rl, "sending to collector failed: %s", - strerror(errno)); + for (i = 0; i < c->n_fds; i++) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + if (send(c->fds[i], payload, n, 0) == -1) { + VLOG_WARN_RL(&rl, "sending to collector failed: %s", + strerror(errno)); + } } } }