[ovs-dev] [sFlow 7/7] netflow: Break out code for sending packets into a new "collectors" module.
Ben Pfaff
blp at nicira.com
Mon Nov 23 22:00:34 UTC 2009
Justin Pettit <jpettit at nicira.com> writes:
> On Nov 19, 2009, at 1:49 PM, Ben Pfaff wrote:
>
>> +/* Opens the targets specified in 'targets' for sending UDP packets. This is
>> + * useful for e.g. sending NetFlow or sFlow packets. Returns 0 if successful,
>> + * otherwise a positive errno value if opening at least one collector failed.
>> + *
>> + * Each target in 'targets' should be a string in the format "[<port>][:<ip>]".
>
> I think you grabbed the description from inet_open_passive()
> instead of inet_open_active(). I believe that should read
> "<host>[:<port>]".
Thanks, good catch.
>> +
>> + error = inet_open_active(SOCK_DGRAM, name, default_port, NULL, &fd);
>> + if (!error) {
>> + c->fds[c->n_fds++] = fd;
>
> I think you want to do the same sort of check here as you did
>in the previous patch, since inet_open_active() could return
>EAGAIN and leak the file descriptor.
Thank you, I updated this and pushed it out.
> Otherwise, looks good.
That must be a very compelling meeting if you can review code at
the same time!
More information about the dev
mailing list