Re: [PATCH] conntrack: do not print garbage after the usage message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hannes Eder wrote:
[cc: -netdev, +netfilter]

Hannes Eder wrote:
diff --git a/src/conntrack.c b/src/conntrack.c
index 42b5133..5ca68d1 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -1493,7 +1493,7 @@ int main(int argc, char *argv[])
free_options(); - if (exit_msg[cmd][0]) {
+    if (cmd != CT_NONE && exit_msg[cmd][0]) {

Ups, this does not work, in case of

# conntrack -L conntrack
...

the final:

conntrack v0.9.13 (conntrack-tools): XXX flow entries have been shown.

Is missing, the following should do the trick.  Sorry for the noise.

From: Hannes Eder <heder@xxxxxxxxxx>

When 'conntrack' is called with no arguments then garbage is printed
after the usage message.  This patch fixes this.

Signed-off-by: Hannes Eder <heder@xxxxxxxxxx>
---

diff --git a/src/conntrack.c b/src/conntrack.c
index 5ca68d1..0053a28 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -1493,7 +1493,7 @@ int main(int argc, char *argv[])

        free_options();

-       if (cmd != CT_NONE && exit_msg[cmd][0]) {
+       if (command && exit_msg[cmd][0]) {
                fprintf(stderr, "%s v%s (conntrack-tools): ",PROGNAME,VERSION);
                fprintf(stderr, exit_msg[cmd], counter);
                if (counter == 0 && !(command & (CT_LIST | EXP_LIST)))


--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux