X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fcollectors.c;h=4501d2b215d0d274e2c7cabac4112f3439e87c2c;hb=HEAD;hp=bd3e89b19ac21a751eb092486e6420f823e7836f;hpb=81e2083fe6b7c16055f01c4b1e40f25867594bf6;p=sliver-openvswitch.git diff --git a/ofproto/collectors.c b/ofproto/collectors.c index bd3e89b19..4501d2b21 100644 --- a/ofproto/collectors.c +++ b/ofproto/collectors.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,14 +63,14 @@ collectors_create(const struct sset *targets, uint16_t default_port, int error; int fd; - error = inet_open_active(SOCK_DGRAM, name, default_port, NULL, &fd); + error = inet_open_active(SOCK_DGRAM, name, default_port, NULL, &fd, 0); if (fd >= 0) { c->fds[c->n_fds++] = fd; } else { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_WARN_RL(&rl, "couldn't open connection to collector %s (%s)", - name, strerror(error)); + name, ovs_strerror(error)); if (!retval) { retval = error; } @@ -112,8 +112,10 @@ collectors_send(const struct collectors *c, const void *payload, size_t n) 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)); + char *s = describe_fd(c->fds[i]); + VLOG_WARN_RL(&rl, "%s: sending to collector failed (%s)", + s, ovs_strerror(errno)); + free(s); } } }