Skip to content

misleading error message while resolving hostname of collector (-n) #6

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
$ softflowd -i eth0 -n blahh:1234
if "blahh" cannot be resolved, the error message
is "address too long" .

What is the expected output? What do you see instead?
"unknown hostname" or something similar

What version of the product are you using? On what operating system?
current (0.9.9) on gentoo linux

Please provide any additional information below.
this small patch works for me:
--- softflowd_orig.c    2012-02-13 02:39:42.000000000 +0100
+++ softflowd.c 2013-08-19 21:22:57.000000000 +0200
@@ -1603,7 +1603,7 @@

        memset(&hints, '\0', sizeof(hints));
        hints.ai_socktype = SOCK_DGRAM;
-       if ((herr = getaddrinfo(host, port, &hints, &res)) == -1) {
+       if ((herr = getaddrinfo(host, port, &hints, &res)) != 0) {
                fprintf(stderr, "Address lookup failed: %s\n",
                    gai_strerror(herr));
                exit(1);

output is "Address lookup failed: Name or service not known"
as expected.

Original issue reported on code.google.com by rittner....@googlemail.com on 19 Aug 2013 at 7:33

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions