* [PATCH] iproute2 add hoplimit and reordering route options usage and parsing @ 2009-10-05 8:54 Gilad Ben-Yossef 2009-10-06 11:41 ` Andreas Henriksson 0 siblings, 1 reply; 7+ messages in thread From: Gilad Ben-Yossef @ 2009-10-05 8:54 UTC (permalink / raw) To: netdev; +Cc: ori From: Yuki Arbel <yuki@comsleep.com> iproute2 git HEAD (spotted originally on 2.6.26, so it's probably not new) does not parse the hoplimit route option when proccessing parameters, nor does it print hoplimit and reordering options in the usage lines. This patch fixes both. Tested by setting hoplimit and be retreiving it via "show". Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com> [ported to HEAD and fixed a bug with hoplimit lock handling in original] Signed-off-by: Ori Finkelman <ori@comsleep.com> Signed-off-by: Yuki Arbel <yuki@comsleep.com> --- Carved out from original patch by Yuki Arbel and Ori Finkelman from Comsleep Ltd. which I'm asssiting in mainlining. diff --git a/ip/iproute.c b/ip/iproute.c index bf0f31b..4821a1d 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -73,7 +73,7 @@ static void usage(void) fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ]\n"); fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"); fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n"); - fprintf(stderr, " [ rto_min TIME ]\n"); + fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] [ reordering NUMBER] \n"); fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n"); fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n"); fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n"); @@ -768,6 +768,16 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) if (get_unsigned(&mtu, *argv, 0)) invarg("\"mtu\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu); + } else if (strcmp(*argv, "hoplimit") == 0) { + unsigned hoplimit; + NEXT_ARG(); + if (strcmp(*argv, "lock") == 0) { + mxlock |= (1<<RTAX_HOPLIMIT); + NEXT_ARG(); + } + if (get_unsigned(&hoplimit, *argv, 0)) + invarg("\"hoplimit\" value is invalid\n", *argv); + rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplimit); #ifdef RTAX_ADVMSS } else if (strcmp(*argv, "advmss") == 0) { unsigned mss; ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] iproute2 add hoplimit and reordering route options usage and parsing 2009-10-05 8:54 [PATCH] iproute2 add hoplimit and reordering route options usage and parsing Gilad Ben-Yossef @ 2009-10-06 11:41 ` Andreas Henriksson 2009-10-06 12:37 ` Gilad Ben-Yossef 0 siblings, 1 reply; 7+ messages in thread From: Andreas Henriksson @ 2009-10-06 11:41 UTC (permalink / raw) To: Gilad Ben-Yossef; +Cc: netdev, ori Hello! On Mon, Oct 05, 2009 at 10:54:21AM +0200, Gilad Ben-Yossef wrote: > iproute2 git HEAD (spotted originally on 2.6.26, so it's probably not new) > does not parse the hoplimit route option when proccessing parameters, nor > does it print hoplimit and reordering options in the usage lines. I'm happy you brought this up and know the author. The Debian package has been carrying this code, which is now in the form of a patch available here: http://git.debian.org/?p=collab-maint/pkg-iproute.git;a=blob;f=debian/patches/hoplimit.dpatch I didn't know who the original author was which is why I haven't submitted it, but it seems you know the history.... The above patch also includes some minor documentation updates which you seem to be missing and might want to integrate in your version of the patch. Looking forward to be able to drop the patch in the debian package! Regards, Andreas Henriksson ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iproute2 add hoplimit and reordering route options usage and parsing 2009-10-06 11:41 ` Andreas Henriksson @ 2009-10-06 12:37 ` Gilad Ben-Yossef 2009-10-06 13:40 ` [PATCH] iproute2 add hoplimit parsing and update usage and documentation Gilad Ben-Yossef 0 siblings, 1 reply; 7+ messages in thread From: Gilad Ben-Yossef @ 2009-10-06 12:37 UTC (permalink / raw) To: Andreas Henriksson; +Cc: netdev, ori Andreas Henriksson wrote: > Hello! > > On Mon, Oct 05, 2009 at 10:54:21AM +0200, Gilad Ben-Yossef wrote: > >> iproute2 git HEAD (spotted originally on 2.6.26, so it's probably not new) >> does not parse the hoplimit route option when proccessing parameters, nor >> does it print hoplimit and reordering options in the usage lines. >> > > I'm happy you brought this up and know the author. The Debian package > has been carrying this code, which is now in the form of a patch available > here: > http://git.debian.org/?p=collab-maint/pkg-iproute.git;a=blob;f=debian/patches/hoplimit.dpatch > > I didn't know who the original author was which is why I haven't submitted it, > but it seems you know the history.... > Not exactly. I know the history of the patch *I sent* (and btw, it seems I got the author name wrong). I don't think it is related to the one Debian is carrying. > The above patch also includes some minor documentation updates which you seem > to be missing and might want to integrate in your version of the patch. > All right. I will add those documentation changes as well and resend as version 2. > Looking forward to be able to drop the patch in the debian package! > > > > I take it you ACK the patch as the Debian package maintainer? Thanks! Gilad -- Gilad Ben-Yossef Chief Coffee Drinker & CTO Codefidence Ltd. Web: http://codefidence.com Cell: +972-52-8260388 Skype: gilad_codefidence Tel: +972-8-9316883 ext. 201 Fax: +972-8-9316884 Email: gilad@codefidence.com Check out our Open Source technology and training blog - http://tuxology.net "Now the world has gone to bed Darkness won't engulf my head I can see by infra-red How I hate the night." ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] iproute2 add hoplimit parsing and update usage and documentation 2009-10-06 12:37 ` Gilad Ben-Yossef @ 2009-10-06 13:40 ` Gilad Ben-Yossef 2009-10-06 17:14 ` Eric Dumazet 2009-12-01 23:53 ` Stephen Hemminger 0 siblings, 2 replies; 7+ messages in thread From: Gilad Ben-Yossef @ 2009-10-06 13:40 UTC (permalink / raw) To: netdev; +Cc: Ori Finkelman, Andreas Henriksson From: Gilad Ben-Yossef <gilad@codefidence.com> - Parse and handle the hoplimit ip route option and add it to the usage line and documentation. - Add the missing reordering ip route option to the usage line. - Add documentation for initcwnd ip route option. Tested by setting hoplimit and retreiving it via "show". Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com> [ported to HEAD, fixed a bug with hoplimit lock handling, added documentation] Signed-off-by: Ori Finkelman <ori@comsleep.com> Signed-off-by: Yony Amit <yony@comsleep.com> --- Debian is carrying a patch with identical functionality for some time now it seems. Parts of this patch carved out from original patch by Yony Amit and Ori Finkelman from Comsleep Ltd. with minor bug fixing and HEAD port by me. Additional documentation bits inspired by Debian patch with unknown author provided by Andreas Henriksson <andreas@fatal.se> diff --git a/doc/ip-cref.tex b/doc/ip-cref.tex index bb4eb78..f81adc5 100644 --- a/doc/ip-cref.tex +++ b/doc/ip-cref.tex @@ -1324,7 +1324,17 @@ peers are allowed to send to us. If it is not given, Linux uses the value selected with \verb|sysctl| variable \verb|net/ipv4/tcp_reordering|. +\item \verb|hoplimit NUMBER| +--- [2.5.74+ only] Maximum number of hops on the path to this destination. + The default is the value selected with the \verb|sysctl| variable + \verb|net/ipv4/ip_default_ttl|. + +\item \verb|initcwnd NUMBER| +--- [2.5.70+ only] Initial congestion window size for connections to + this destination. Actual window size is this value multiplied by the + MSS (``Maximal Segment Size'') for same connection. The default is + zero, meaning to use the values specified in~\cite{RFC2414}. \item \verb|nexthop NEXTHOP| @@ -2653,6 +2663,9 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios120. \bibitem{RFC-DHCP} R.~Droms. ``Dynamic Host Configuration Protocol.'', RFC-2131 +\bibitem{RFC2414} M.~Allman, S.~Floyd, C.~Partridge. +``Increasing TCP's Initial Window'', RFC-2414. + \end{thebibliography} diff --git a/ip/iproute.c b/ip/iproute.c index bf0f31b..aeea93d 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -13,6 +13,8 @@ * * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses * Kunihiro Ishiguro <kunihiro@zebra.org> 001102: rtnh_ifindex was not initialized + * Gilad Ben-Yossef <gilad@codefidence.com> 091006: Add hoplimit option parsing + * and correct usage */ #include <stdio.h> @@ -70,10 +72,10 @@ static void usage(void) fprintf(stderr, "INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...\n"); fprintf(stderr, "NH := [ via ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS\n"); fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n"); - fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ]\n"); + fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ] [reordering NUMBER ]\n"); fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"); fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n"); - fprintf(stderr, " [ rto_min TIME ]\n"); + fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] \n"); fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n"); fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n"); fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n"); @@ -768,6 +770,18 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) if (get_unsigned(&mtu, *argv, 0)) invarg("\"mtu\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu); +#ifdef RTAX_HOPLIMIT + } else if (strcmp(*argv, "hoplimit") == 0) { + unsigned hoplimit; + NEXT_ARG(); + if (strcmp(*argv, "lock") == 0) { + mxlock |= (1<<RTAX_HOPLIMIT); + NEXT_ARG(); + } + if (get_unsigned(&hoplimit, *argv, 0)) + invarg("\"hoplimit\" value is invalid\n", *argv); + rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplimit); +#endif #ifdef RTAX_ADVMSS } else if (strcmp(*argv, "advmss") == 0) { unsigned mss; ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] iproute2 add hoplimit parsing and update usage and documentation 2009-10-06 13:40 ` [PATCH] iproute2 add hoplimit parsing and update usage and documentation Gilad Ben-Yossef @ 2009-10-06 17:14 ` Eric Dumazet 2009-10-06 17:34 ` Stephen Hemminger 2009-12-01 23:53 ` Stephen Hemminger 1 sibling, 1 reply; 7+ messages in thread From: Eric Dumazet @ 2009-10-06 17:14 UTC (permalink / raw) To: Gilad Ben-Yossef Cc: netdev, Ori Finkelman, Andreas Henriksson, Stephen Hemminger Gilad Ben-Yossef a écrit : > From: Gilad Ben-Yossef <gilad@codefidence.com> > > - Parse and handle the hoplimit ip route option and add it to the usage > line and documentation. > > - Add the missing reordering ip route option to the usage line. > > - Add documentation for initcwnd ip route option. > > Tested by setting hoplimit and retreiving it via "show". > > Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com> > [ported to HEAD, fixed a bug with hoplimit lock handling, added documentation] > Signed-off-by: Ori Finkelman <ori@comsleep.com> > Signed-off-by: Yony Amit <yony@comsleep.com> > > --- a/ip/iproute.c > +++ b/ip/iproute.c > @@ -13,6 +13,8 @@ > * > * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses > * Kunihiro Ishiguro <kunihiro@zebra.org> 001102: rtnh_ifindex was not initialized > + * Gilad Ben-Yossef <gilad@codefidence.com> 091006: Add hoplimit option parsing > + * and correct usage Well, git/web history is much better than this, you dont need to add this comment. Acked-by: Eric Dumazet <eric.dumazet@gmail.com> patch should be sent to iproute2 maintainer, Stephen Hemminger <shemminger@vyatta.com> He might be too busy to catch netdev mails these days, I dont know :) Thanks ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iproute2 add hoplimit parsing and update usage and documentation 2009-10-06 17:14 ` Eric Dumazet @ 2009-10-06 17:34 ` Stephen Hemminger 0 siblings, 0 replies; 7+ messages in thread From: Stephen Hemminger @ 2009-10-06 17:34 UTC (permalink / raw) To: Eric Dumazet; +Cc: Gilad Ben-Yossef, netdev, Ori Finkelman, Andreas Henriksson On Tue, 06 Oct 2009 19:14:28 +0200 Eric Dumazet <eric.dumazet@gmail.com> wrote: > Gilad Ben-Yossef a écrit : > > From: Gilad Ben-Yossef <gilad@codefidence.com> > > > > - Parse and handle the hoplimit ip route option and add it to the usage > > line and documentation. > > > > - Add the missing reordering ip route option to the usage line. > > > > - Add documentation for initcwnd ip route option. > > > > Tested by setting hoplimit and retreiving it via "show". > > > > Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com> > > [ported to HEAD, fixed a bug with hoplimit lock handling, added documentation] > > Signed-off-by: Ori Finkelman <ori@comsleep.com> > > Signed-off-by: Yony Amit <yony@comsleep.com> > > > > > --- a/ip/iproute.c > > +++ b/ip/iproute.c > > @@ -13,6 +13,8 @@ > > * > > * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses > > * Kunihiro Ishiguro <kunihiro@zebra.org> 001102: rtnh_ifindex was not initialized > > + * Gilad Ben-Yossef <gilad@codefidence.com> 091006: Add hoplimit option parsing > > + * and correct usage > > Well, git/web history is much better than this, you dont need to add this comment. > > Acked-by: Eric Dumazet <eric.dumazet@gmail.com> > > patch should be sent to iproute2 maintainer, Stephen Hemminger <shemminger@vyatta.com> > > He might be too busy to catch netdev mails these days, I dont know :) > > Thanks I catch them, but collect iproute patches and put them in batches around release time. -- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iproute2 add hoplimit parsing and update usage and documentation 2009-10-06 13:40 ` [PATCH] iproute2 add hoplimit parsing and update usage and documentation Gilad Ben-Yossef 2009-10-06 17:14 ` Eric Dumazet @ 2009-12-01 23:53 ` Stephen Hemminger 1 sibling, 0 replies; 7+ messages in thread From: Stephen Hemminger @ 2009-12-01 23:53 UTC (permalink / raw) To: Gilad Ben-Yossef; +Cc: netdev, Ori Finkelman, Andreas Henriksson On Tue, 06 Oct 2009 15:40:34 +0200 Gilad Ben-Yossef <gilad@codefidence.com> wrote: > diff --git a/ip/iproute.c b/ip/iproute.c > index bf0f31b..aeea93d 100644 > --- a/ip/iproute.c > +++ b/ip/iproute.c > @@ -13,6 +13,8 @@ > * > * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses > * Kunihiro Ishiguro <kunihiro@zebra.org> 001102: rtnh_ifindex was not initialized > + * Gilad Ben-Yossef <gilad@codefidence.com> 091006: Add hoplimit option parsing > + * and correct usage > */ > Applied except I removed the comment changelogs from all of iproute now to discourage individual source attribution. The contributor information exists in the git data. -- ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-12-01 23:54 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-10-05 8:54 [PATCH] iproute2 add hoplimit and reordering route options usage and parsing Gilad Ben-Yossef 2009-10-06 11:41 ` Andreas Henriksson 2009-10-06 12:37 ` Gilad Ben-Yossef 2009-10-06 13:40 ` [PATCH] iproute2 add hoplimit parsing and update usage and documentation Gilad Ben-Yossef 2009-10-06 17:14 ` Eric Dumazet 2009-10-06 17:34 ` Stephen Hemminger 2009-12-01 23:53 ` Stephen Hemminger
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).