[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <11895409552209-git-send-email-jheffner@psc.edu>
Date: Tue, 11 Sep 2007 16:02:35 -0400
From: John Heffner <jheffner@....edu>
To: shemminger@...ux-foundation.org
Cc: netdev@...r.kernel.org, John Heffner <jheffner@....edu>
Subject: [PATCH 2/2] [IPROUTE2] ss: parse bare integers are port numbers rather than IP addresses
Signed-off-by: John Heffner <jheffner@....edu>
---
misc/ss.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 5d14f13..d617f6d 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -953,6 +953,10 @@ void *parse_hostcond(char *addr)
memset(&a, 0, sizeof(a));
a.port = -1;
+ /* Special case: integer by itself is considered a port number */
+ if (!get_integer(&a.port, addr, 0))
+ goto out;
+
if (fam == AF_UNIX || strncmp(addr, "unix:", 5) == 0) {
char *p;
a.addr.family = AF_UNIX;
--
1.5.3.rc4.29.g74276-dirty
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists