Signed-off-by: John Heffner <[EMAIL PROTECTED]> --- tracepath.c | 10 ++++++++-- tracepath6.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/tracepath.c b/tracepath.c index c3f6f74..1f901ba 100644 --- a/tracepath.c +++ b/tracepath.c @@ -265,7 +265,7 @@ static void usage(void) __attribute((noreturn)); static void usage(void) { - fprintf(stderr, "Usage: tracepath [-n] <destination>[/<port>]\n"); + fprintf(stderr, "Usage: tracepath [-n] [-l <len>] <destination>[/<port>]\n"); exit(-1); } @@ -279,11 +279,17 @@ main(int argc, char **argv) char *p; int ch; - while ((ch = getopt(argc, argv, "nh?")) != EOF) { + while ((ch = getopt(argc, argv, "nh?l:")) != EOF) { switch(ch) { case 'n': no_resolve = 1; break; + case 'l': + if ((mtu = atoi(optarg)) <= overhead) { + fprintf(stderr, "Error: length must be >= %d\n", overhead); + exit(1); + } + break; default: usage(); } diff --git a/tracepath6.c b/tracepath6.c index 23d6a8c..d65230d 100644 --- a/tracepath6.c +++ b/tracepath6.c @@ -280,7 +280,7 @@ static void usage(void) __attribute((noreturn)); static void usage(void) { - fprintf(stderr, "Usage: tracepath6 [-n] [-b] <destination>[/<port>]\n"); + fprintf(stderr, "Usage: tracepath6 [-n] [-b] [-l <len>] <destination>[/<port>]\n"); exit(-1); } @@ -297,7 +297,7 @@ int main(int argc, char **argv) int gai; char pbuf[NI_MAXSERV]; - while ((ch = getopt(argc, argv, "nbh?")) != EOF) { + while ((ch = getopt(argc, argv, "nbh?l:")) != EOF) { switch(ch) { case 'n': no_resolve = 1; @@ -305,6 +305,12 @@ int main(int argc, char **argv) case 'b': show_both = 1; break; + case 'l': + if ((mtu = atoi(optarg)) <= overhead) { + fprintf(stderr, "Error: length must be >= %d\n", overhead); + exit(1); + } + break; default: usage(); } -- 1.5.0.2.gc260-dirty - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html