From: John Heffner <jheffner@psc.edu>
To: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: netdev@vger.kernel.org, John Heffner <jheffner@psc.edu>
Subject: [PATCH 1/2] [iputils] Add length flag to set initial MTU.
Date: Fri, 23 Mar 2007 20:07:21 -0400 [thread overview]
Message-ID: <11746948424197-git-send-email-jheffner@psc.edu> (raw)
Signed-off-by: John Heffner <jheffner@psc.edu>
---
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
next reply other threads:[~2007-03-24 0:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-24 0:07 John Heffner [this message]
2007-03-24 0:07 ` [PATCH 2/2] [iputils] Use PMTUDISC_PROBE mode if it exists John Heffner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11746948424197-git-send-email-jheffner@psc.edu \
--to=jheffner@psc.edu \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).