Skip to contentSkip to conversation

iproute2: resend of patches from Debian.

PATCH Andreas Henriksson 6 participants 15 messages Oct 11, 2007 – Oct 12, 2007

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hello all!

Posting this set of patches again, since there where no reaction last time I sent them.

Regards,
Andreas Henriksson

----

Hello Stephen Hemminger and the rest of the people on the nevdev list!

I'm posting a bunch of patches for iproute2. A few I've written myself and have a Signed-off-by with my name in them, the others I've picked up from the iproute package in Debian. I tried my best to add a decent description, references to debian bug number and when possible a From header suggesting who the original author might be.
They should all apply with some offset and sometimes a bit fuzz to the current iproute2 git tree.

new patches posted to the debian bug tracking system:
add-mpath-docs.diff
doublefree.diff
fix-layer-syntax.diff
new-manpages.diff
tick2time-fix.diff
wrandom-fix.diff

fixes in the debian iproute package:
empty_linkname.diff
ip_address_flush_loop.diff
lartc.diff
netbug_fix.diff
okey-ikey.diff
remove_tc_filters_reference.diff

patches updating help text syntax:
ip_route_usage.diff
ip_rule_usage.diff

patches fixing documentation typos:
fix_ss_typo.diff
ip.8-typo.diff
ip_address.diff
libnetlink_typo.diff
manpages-typo.diff
tcb_htb_typo.diff
tc_cbq_details_typo.diff

Signature · 2 lines
Regards,
Andreas Henriksson

Disallow empty link name.

From: Alexander Wirt <[email protected]>

Patch from debian iproute package.

ip/iplink.c +4 -0
diff -urNad iproute-20060323~/ip/iplink.c iproute-20060323/ip/iplink.c
@@ -384,6 +384,10 @@
 	}
 
 	if (newname && strcmp(dev, newname)) {
+		if (strlen(newname) == 0) {
+		    printf("\"\" is not valid device identifier\n",dev);
+		    return -1;
+		}
 		if (do_changename(dev, newname) < 0)
 			return -1;
 		dev = newname;

Abort flush after 10 seconds.

From: Alexander Wirt <[email protected]>

Patch from Debian iproute package.

ip/ipaddress.c +8 -0
diff -urNad iproute-20060323~/ip/ipaddress.c iproute-20060323/ip/ipaddress.c
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <time.h>
 #include <syslog.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -589,6 +590,7 @@
 	if (flush) {
 		int round = 0;
 		char flushb[4096-512];
+		time_t start = time(0);
 
 		filter.flushb = flushb;
 		filter.flushp = 0;
@@ -617,6 +619,12 @@
 				printf("Warum?\n");
 				return 1;
 
+                        if (time(0) - start > 10) {
+                                printf("\n*** Flush not completed after %ld seconds, %d entries remain ***\n",
+                                       time(0) - start, filter.flushed);
+                                exit(1);
+                        }
+
 			if (show_stats) {
 				printf("\n*** Round %d, deleting %d addresses ***\n", round, filter.flushed);
 				fflush(stdout);

Add references to lartc, also drop bogus reference to tc-filters

Patch from Debian iproute package.

man/man8/ip.8 +2 -0
diff -Nur old/man/man8/ip.8 new/man/man8/ip.8
@@ -1803,6 +1803,8 @@
 .RB "IP Command reference " ip-cref.ps
 .br
 .RB "IP tunnels " ip-cref.ps
+.br
+.RB http://lartc.org/
 
 .SH AUTHOR
 
man/man8/tc.8 +1 -1
diff -Nur old/man/man8/tc.8 new/man/man8/tc.8
@@ -341,7 +341,7 @@
 .BR tc-pfifo (8),
 .BR tc-bfifo (8),
 .BR tc-pfifo_fast (8),
-.BR tc-filters (8)
+.BR http://lartc.org/
 
 .SH AUTHOR
 Manpage maintained by bert hubert ([email protected])

Fix misc/netbug script.

See the following debian bugs:
http://bugs.debian.org/289541
http://bugs.debian.org/313540
http://bugs.debian.org/313541
http://bugs.debian.org/313544
http://bugs.debian.org/347699

Changes from Debian iproute package rediffed to apply against current iproute2 git tree.

misc/netbug +8 -16
@@ -1,23 +1,16 @@
 #! /bin/bash
 
+set -e
+
 echo -n "Send network configuration summary to [ENTER means [email protected]] "
 IFS="" read mail || exit 1
 [ -z "$mail" ] && [email protected]
 
+netbug=`mktemp -d -t netbug.XXXXXX` || (echo "$0: Cannot create temporary directory" >&2; exit 1; )
+netbugtar=`tempfile -d $netbug --suffix=tar.gz` || (echo "$0: Cannot create temporary file" >&2; exit 1; )
+tmppath=$netbug
+trap "/bin/rm -rf $netbug $netbugtar" 0 1 2 3 13 15
 
-netbug=""
-while [ "$netbug" = "" ]; do
-	netbug=`echo netbug.$$.$RANDOM`
-	if [ -e /tmp/$netbug ]; then
-		netbug=""
-	fi
-done
-
-tmppath=/tmp/$netbug
-
-trap "rm -rf $tmppath $tmppath.tar.gz" 0 SIGINT
-
-mkdir $tmppath
 mkdir $tmppath/net
 
 cat /proc/slabinfo > $tmppath/slabinfo
@@ -44,9 +37,8 @@
 fi
 
 cd /tmp
-tar c $netbug | gzip -9c > $netbug.tar.gz
-
-uuencode $netbug.tar.gz $netbug.tar.gz | mail -s $netbug "$mail"
+tar c $tmppath | gzip -9c > $netbugtar
+uuencode $netbugtar $netbugtar | mail -s $netbug "$mail"
 
 echo "Sending to <$mail>; subject is $netbug"
 

Fix typo in GRE tunnels (i_key vs. o_key).

From: <[email protected]>

If a dotted quad ikey is specified for GRE tunnels, it gets set as the okey instead. This patch fixes it.

See Debian bug #200714 - http://bugs.debian.org/200714

Patch from Debian iproute package.

ip/iptunnel.c 2003-07-10 11:47:11.000000000 +1000 renamed from ip/iptunnel.c.orig 2003-07-10 11:47:06.000000000 +1000 +0 -0
@@ -221,7 +221,7 @@
			NEXT_ARG();
			p->i_flags |= GRE_KEY;
			if (strchr(*argv, '.'))
-				p->o_key = get_addr32(*argv);
+				p->i_key = get_addr32(*argv);
			else {
				if (get_unsigned(&uval, *argv, 0)<0) {
					fprintf(stderr, "invalid value of \"ikey\"\n");

Remove bogus reference to tc-filters(8) from tc(8) manpage.

See debian bug #289225 - http://bugs.debian.org/289225

Patch from Debian iproute package.

man/man8/tc.8 +2 -4
diff -urNad iproute-20070313~/man/man8/tc.8 iproute-20070313/man/man8/tc.8
@@ -202,8 +202,7 @@
 tc filters
 If tc filters are attached to a class, they are consulted first 
 for relevant instructions. Filters can match on all fields of a packet header, 
-as well as on the firewall mark applied by ipchains or iptables. See 
-.BR tc-filters (8).
+as well as on the firewall mark applied by ipchains or iptables. 
 .TP
 Type of Service
 Some qdiscs have built in rules for classifying packets based on the TOS field.
@@ -242,8 +241,7 @@
 .TP 
 FILTERS
 Filters have a three part ID, which is only needed when using a hashed
-filter hierarchy, for which see
-.BR tc-filters (8).
+filter hierarchy.
 .SH UNITS
 All parameters accept a floating point number, possibly followed by a unit.
 .P

Add mpath to ip manpage.

From: Norbert Buchmuller <[email protected]>

The 'mpath' parameter of 'ip route' is not documented in the manual page nor in ip-cref.tex.

...huge part of the text in the patch was taken from the net/ipv4/Kconfig file in the Linux kernel source (2.6.18). I suppose that's OK because both Linux and iproute2 are GPL'd, but I let you know anyway.

See Debian bug #428442 - http://bugs.debian.org/428442

doc/ip-cref.tex +22 -0
diff -Naur iproute-20061002/doc/ip-cref.tex iproute-20061002.fixed/doc/ip-cref.tex
@@ -1348,6 +1348,28 @@
 route reflecting its relative bandwidth or quality.
 \end{itemize}
 
+\item \verb|mpath MP_ALGO|
+
+--- the  multipath algo to use.
+\verb|MP_ALGO| may be one of the following values:
+\begin{itemize}
+\item \verb|rr| --- round robin algorithm.
+Multipath routes are chosen according to Round Robin.
+\item \verb|drr| --- interface round robin algorithm.
+Connections are distributed in a round robin fashion over the
+available interfaces. This policy makes sense if the connections 
+should be primarily distributed on interfaces and not on routes.
+\item \verb|random| --- random algorithm.
+Multipath routes are chosen in a random fashion. Actually,
+there is no weight for a route. The advantage of this policy
+is that it is implemented stateless and therefore introduces only
+a very small delay.
+\item \verb|wrandom| --- weighted random algorithm.
+Multipath routes are chosen in a weighted random fashion. 
+The per route weights are the weights visible via ip route 2. As the
+corresponding state management introduces some overhead routing delay
+is increased.
+\end{itemize}
 \item \verb|scope SCOPE_VAL|
 
 --- the scope of the destinations covered by the route prefix.
man/man8/ip.8 +39 -1
diff -Naur iproute-20061002/man/man8/ip.8 iproute-20061002.fixed/man/man8/ip.8
@@ -146,7 +146,9 @@
 .B  scope
 .IR SCOPE " ] [ "
 .B  metric
-.IR METRIC " ]"
+.IR METRIC " ] [ "
+.B  mpath
+.IR MP_ALGO " ]"
 
 .ti -8
 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
@@ -205,6 +207,10 @@
 .BR onlink " | " pervasive " ]"
 
 .ti -8
+.IR MP_ALGO " := [ "
+.BR rr " | " drr " | " random " | " wrandom " ]"
+
+.ti -8
 .IR RTPROTO " := [ "
 .BR kernel " | " boot " | " static " |"
 .IR NUMBER " ]"
@@ -1116,6 +1122,38 @@
 .in -8
 
 .TP
+.BI mpath " MP_ALGO"
+the multipath algo to use.
+.I MP_ALGO
+may be one of the following values:
+
+.in +8
+.B rr
+- round robin algorithm.
+Multipath routes are chosen according to Round Robin.
+.sp
+.B drr
+- interface round robin algorithm.
+Connections are distributed in a round robin fashion over the
+available interfaces. This policy makes sense if the connections 
+should be primarily distributed on interfaces and not on routes.
+.sp
+.B random
+- random algorithm.
+Multipath routes are chosen in a random fashion. Actually,
+there is no weight for a route. The advantage of this policy
+is that it is implemented stateless and therefore introduces only
+a very small delay.
+.sp
+.B wrandom
+- weighted random algorithm.
+Multipath routes are chosen in a weighted random fashion. 
+The per route weights are the weights visible via ip route 2. As the
+corresponding state management introduces some overhead routing delay
+is increased.
+.in -8
+
+.TP
 .BI scope " SCOPE_VAL"
 the scope of the destinations covered by the route prefix.
 .I SCOPE_VAL

Fix corruption when using batch files with comments and broken lines.

See Debian bug #398912 - http://bugs.debian.org/398912

include/utils.h +1 -1
diff -urip iproute-20061002/include/utils.h iproute-20061002.fixed2/include/utils.h
@@ -132,7 +132,7 @@ int print_timestamp(FILE *fp);
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
 extern int cmdlineno;
-extern size_t getcmdline(char **line, size_t *len, FILE *in);
+extern ssize_t getcmdline(char **line, size_t *len, FILE *in);
 extern int makeargs(char *line, char *argv[], int maxargs);
 
 #endif /* __UTILS_H__ */
lib/utils.c +5 -3
diff -urip iproute-20061002/lib/utils.c iproute-20061002.fixed2/lib/utils.c
@@ -578,9 +578,9 @@ int print_timestamp(FILE *fp)
 int cmdlineno;
 
 /* Like glibc getline but handle continuation lines and comments */
-size_t getcmdline(char **linep, size_t *lenp, FILE *in)
+ssize_t getcmdline(char **linep, size_t *lenp, FILE *in)
 {
-	size_t cc;
+	ssize_t cc;
 	char *cp;
 		
 	if ((cc = getline(linep, lenp, in)) < 0)
@@ -608,9 +608,11 @@ size_t getcmdline(char **linep, size_t *
 		if (cp) 
 			*cp = '\0';
 
-		*linep = realloc(*linep, strlen(*linep) + strlen(line1) + 1);
+		*lenp = strlen(*linep) + strlen(line1) + 1;
+		*linep = realloc(*linep, *lenp);
 		if (!*linep) {
 			fprintf(stderr, "Out of memory\n");
+			*lenp = 0;
 			return -1;
 		}
 		cc += cc1 - 2;

Fix ematch cmp and nbyte syntax help text.

From: Lionel Elie Mamane <[email protected]>

The help/usage screen of ematch cmp and nbyte say recognised symbolic values for "layer FOO" are link, header and next-header, but the code does _not_ implement that: it will recognise "next-header" as what is supposed to be "header" and will not recognise "header". The right symbolic values seem to be link, network, transport. Here is a patch that changes the help/usage screen to match the code.

See Debian bug #438653 - http://bugs.debian.org/438653

tc/em_cmp.c +2 -2
diff --recursive -N -u iproute-20070313.deb/tc/em_cmp.c iproute-20070313.lio/tc/em_cmp.c
@@ -1,5 +1,5 @@
 /*
- * em_cmp.c		Simle coparison Ematch
+ * em_cmp.c		Simple comparison Ematch
  *
  *		This program is free software; you can distribute it and/or
  *		modify it under the terms of the GNU General Public License
@@ -32,7 +32,7 @@
 	    "Usage: cmp(ALIGN at OFFSET [ ATTRS ] { eq | lt | gt } VALUE)\n" \
 	    "where: ALIGN  := { u8 | u16 | u32 }\n" \
 	    "       ATTRS  := [ layer LAYER ] [ mask MASK ] [ trans ]\n" \
-	    "       LAYER  := { link | header | next-header | 0..%d }\n" \
+	    "       LAYER  := { link | network | transport | 0..%d }\n" \
 	    "\n" \
 	    "Example: cmp(u16 at 3 layer 2 mask 0xff00 gt 20)\n",
 	    TCF_LAYER_MAX);
tc/em_nbyte.c +1 -1
diff --recursive -N -u iproute-20070313.deb/tc/em_nbyte.c iproute-20070313.lio/tc/em_nbyte.c
@@ -32,7 +32,7 @@
 	    "Usage: nbyte(NEEDLE at OFFSET [layer LAYER])\n" \
 	    "where: NEEDLE := { string | \"c-escape-sequence\" }\n" \
 	    "       OFFSET := int\n" \
-	    "       LAYER  := { link | header | next-header | 0..%d }\n" \
+	    "       LAYER  := { link | network | transport | 0..%d }\n" \
 	    "\n" \
 	    "Example: nbyte(\"ababa\" at 12 layer 1)\n",
 	    TCF_LAYER_MAX);

Add new manpages and symlinks.

Symlink rtstat(8) and ctstat(8) to lnstat(8).
Add rtacct/nstat manpage based on doc/nstat.sgml as rtacct(8). Symlink nstat(8) to rtacct(8).
Add arpd(8) symlink based on doc/arpd.sgml.

Makefile +3 -0
index af0d5e4..6c976dd 100644
@@ -53,6 +53,9 @@ install: all
 	install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
 	install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8
 	ln -sf tc-bfifo.8  $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8
+	ln -sf lnstat.8  $(DESTDIR)$(MANDIR)/man8/rtstat.8
+	ln -sf lnstat.8  $(DESTDIR)$(MANDIR)/man8/ctstat.8
+	ln -sf rtacct.8  $(DESTDIR)$(MANDIR)/man8/nstat.8
 	install -m 0755 -d $(DESTDIR)$(MANDIR)/man3
 	install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3
 
man/man8/arpd.8 new file +66 -0

66 lines not on this page · raw message

man/man8/rtacct.8 new file +48 -0

48 lines not on this page · raw message

Fix overflow in time2tick / tick2time.

The helper functions gets passed an unsigned int, which gets cast to long and overflows.

See Debian bug #175462 - http://bugs.debian.org/175462

tc/tc_core.c +2 -2
diff -uri iproute-20070313.orig/tc/tc_core.c iproute-20070313/tc/tc_core.c
@@ -35,12 +35,12 @@
 }
 
 
-long tc_core_time2tick(long time)
+unsigned tc_core_time2tick(unsigned time)
 {
 	return time*tick_in_usec;
 }
 
-long tc_core_tick2time(long tick)
+unsigned tc_core_tick2time(unsigned tick)
 {
 	return tick/tick_in_usec;
 }
tc/tc_core.h +2 -2
diff -uri iproute-20070313.orig/tc/tc_core.h iproute-20070313/tc/tc_core.h
@@ -7,8 +7,8 @@
 #define TIME_UNITS_PER_SEC	1000000000
 
 int  tc_core_time2big(long time);
-long tc_core_time2tick(long time);
-long tc_core_tick2time(long tick);
+unsigned tc_core_time2tick(unsigned time);
+unsigned tc_core_tick2time(unsigned tick);
 long tc_core_time2ktime(long time);
 long tc_core_ktime2time(long ktime);
 unsigned tc_calc_xmittime(unsigned rate, unsigned size);

Fix off-by-one in print of wrandom algo.

From: Norbert Buchmuller <[email protected]>

The 'wrandom' multipath algo is recognised when adding the route, but not resolved when it is printed (prints 'unknown'):

ianus:~# ip ro add 1.2.3.4 mpath wrandom nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 2
ianus:~# ip ro get to 1.2.3.4
1.2.3.4 mpath unknown dev ppp0  src 62.77.192.67 
    cache  mtu 1492 advmss 1452 hoplimit 64
ianus:~# ip ro del 1.2.3.4 mpath wrandom nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 2

See Debian bug #428440 - http://bugs.debian.org/428440

ip/iproute.c +1 -1
diff -Naur iproute-20061002/ip/iproute.c iproute-20061002.fixed/ip/iproute.c
@@ -358,7 +358,7 @@
 		__u32 mp_alg = *(__u32*) RTA_DATA(tb[RTA_MP_ALGO]);
 		if (mp_alg > IP_MP_ALG_NONE) {
 			fprintf(fp, "mpath %s ",
-			    mp_alg < IP_MP_ALG_MAX ? mp_alg_names[mp_alg] : "unknown");
+			    mp_alg <= IP_MP_ALG_MAX ? mp_alg_names[mp_alg] : "unknown");
 		}
 	}
 

Add src syntax to route help text.

From: Alexander Wirt <[email protected]>

Add src option to ip_route usage.

See Debian bug #226142 - http://bugs.debian.org/226142

ip/iproute.c +1 -1
diff -urNad iproute-20061002~/ip/iproute.c iproute-20061002/ip/iproute.c
@@ -73,7 +73,7 @@
 	fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n");
 	fprintf(stderr, "           [ rtt NUMBER ] [ rttvar NUMBER ]\n");
 	fprintf(stderr, "           [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
-	fprintf(stderr, "           [ ssthresh NUMBER ] [ realms REALM ]\n");
+	fprintf(stderr, "           [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\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");

Add syntax for rule prio help text.

From: Alexander Wirt <[email protected]>

Add [ prio NUMBER ] to ip_rule.c

See Debian bug #213673 - http://bugs.debian.org/213673

ip/iprule.c +1 -1
diff -urNad iproute-20070313~/ip/iprule.c iproute-20070313/ip/iprule.c
@@ -38,7 +38,7 @@
 {
 	fprintf(stderr, "Usage: ip rule [ list | add | del | flush ] SELECTOR ACTION\n");
 	fprintf(stderr, "SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ]\n");
-	fprintf(stderr, "            [ dev STRING ] [ pref NUMBER ]\n");
+	fprintf(stderr, "            [ dev STRING ] [ pref NUMBER ] [ prio NUMBER ]\n");
 	fprintf(stderr, "ACTION := [ table TABLE_ID ]\n");
 	fprintf(stderr, "          [ prohibit | reject | unreachable ]\n");
 	fprintf(stderr, "          [ realms [SRCREALM/]DSTREALM ]\n");

Fix typo in ss manpage.

Patch from debian iproute package.

man/man8/ss.8 +1 -1
diff -urNad iproute-20070313~/man/man8/ss.8 iproute-20070313/man/man8/ss.8
@@ -9,7 +9,7 @@
 is used to dump socket statistics. It allows showing information similar
 to
 .IR netstat .
-It can display more TCP information than state than other tools.
+It can display more TCP and state informations than other tools.
 
 .SH OPTIONS
 These programs follow the usual GNU command line syntax, with long

Make the backslash visible in ip manpage.

See Debian bug #285507 - http://bugs.debian.org/285507

man/man8/ip.8 +1 -1
@@ -374,7 +374,7 @@
 .BR "\-o" , " \-oneline"
 output each record on a single line, replacing line feeds
 with the
-.B '\'
+.B '\e\'
 character. This is convenient when you want to count records 
 with
 .BR wc (1)

Strict syntax for advice in error message.

ip/ipaddress.c +1 -1
diff -ruN iproute-20051007.orig/ip/ipaddress.c iproute-20051007/ip/ipaddress.c
@@ -901,7 +901,7 @@
 		return ipaddr_list_or_flush(argc-1, argv+1, 1);
 	if (matches(*argv, "help") == 0)
 		usage();
-	fprintf(stderr, "Command \"%s\" is unknown, try \"ip address help\".\n", *argv);
+	fprintf(stderr, "Command \"%s\" is unknown, try \"ip addr help\".\n", *argv);
 	exit(-1);
 }
 

Fix typo in libnetlink manpage (writen -> written).

man/man3/libnetlink.3 +1 -1
diff -urNad iproute-20070313~/man/man3/libnetlink.3 iproute-20070313/man/man3/libnetlink.3
@@ -187,7 +187,7 @@
 This library should be named librtnetlink.
 
 .SH AUTHORS
-netlink/rtnetlink was designed and writen by Alexey Kuznetsov.
+netlink/rtnetlink was designed and written by Alexey Kuznetsov.
 Andi Kleen wrote the man page.
 
 .SH SEE ALSO

Fix typos in tc-prio(8) manpage.

From: Alexander Wirt <[email protected]>

man/man8/tc-prio.8 +4 -4
diff -urNad iproute-20061002~/man/man8/tc-prio.8 iproute-20061002/man/man8/tc-prio.8
@@ -30,7 +30,7 @@
 On creation with 'tc qdisc add', a fixed number of bands is created. Each
 band is a class, although is not possible to add classes with 'tc qdisc
 add', the number of bands to be created must instead be specified on the
-commandline attaching PRIO to its root.
+command line attaching PRIO to its root.
 
 When dequeueing, band 0 is tried first and only if it did not deliver a
 packet does PRIO try band 1, and so onwards. Maximum reliability packets
@@ -88,7 +88,7 @@
 The four TOS bits (the 'TOS field') are defined as:
 
 .nf
-Binary Decimcal  Meaning
+Binary Decimal  Meaning
 -----------------------------------------
 1000   8         Minimize delay (md)
 0100   4         Maximize throughput (mt)
@@ -125,13 +125,13 @@
 
 The second column contains the value of the relevant
 four TOS bits, followed by their translated meaning. For example, 15 stands
-for a packet wanting Minimal Montetary Cost, Maximum Reliability, Maximum
+for a packet wanting Minimal Monetary Cost, Maximum Reliability, Maximum
 Throughput AND Minimum Delay. 
 
 The fourth column lists the way the Linux kernel interprets the TOS bits, by
 showing to which Priority they are mapped.
 
-The last column shows the result of the default priomap. On the commandline,
+The last column shows the result of the default priomap. On the command line,
 the default priomap looks like this:
 
     1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1

Fix typo in tc-htb(8) manpage (mininum -> minimum).

man/man8/tc-htb.8 +1 -1
diff -urNad iproute-20070313~/man/man8/tc-htb.8 iproute-20070313/man/man8/tc-htb.8
@@ -137,7 +137,7 @@
 .SH NOTES
 Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel, 
 there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick.
-From this, the mininum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte 
+From this, the minimum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte 
 burst as 100*12kb*8 equals 10mbit.
 
 .SH SEE ALSO

Fix typo in tc-cbq-details(8) manpage (occured -> occurred).

man/man8/tc-cbq-details.8 +1 -1
diff -urNad iproute-20070313~/man/man8/tc-cbq-details.8 iproute-20070313/man/man8/tc-cbq-details.8
@@ -210,7 +210,7 @@
 priority. If found, choose it, and terminate.
 .TP
 (iii)
-Choose the class at which break out to the fallback algorithm occured. Terminate.
+Choose the class at which break out to the fallback algorithm occurred. Terminate.
 .P
 The packet is enqueued to the class which was chosen when either algorithm 
 terminated. It is therefore possible for a packet to be enqueued *not* at a
#1 lore raw
Quoted 6 lines · Andreas Henriksson

Patch from debian iproute package.

diff -urNad iproute-20060323~/ip/iplink.c iproute-20060323/ip/iplink.c

ip/iplink.c line 393

Quoted 10 lines
ip/iplink.c +4 -0
@@ -384,6 +384,10 @@
 	}
 
 	if (newname && strcmp(dev, newname)) {
+		if (strlen(newname) == 0) {
+		    printf("\"\" is not valid device identifier\n",dev);
+		    return -1;
+		}
 		if (do_changename(dev, newname) < 0)
 			return -1;
 		dev = newname;

Isn't that printf missing somewhere for the 'dev' argument to go?

--
Len Sorensen

#2 lore raw
Quoted 9 lines · Lennart Sorensen
Quoted 8 lines · Andreas Henriksson

Patch from debian iproute package.

diff -urNad iproute-20060323~/ip/iplink.c iproute-20060323/ip/iplink.c

ip/iplink.c +0 -0
@@ -384,6 +384,10 @@
 	}
 
Quoted 10 lines

ip/iplink.c line 393

Quoted 8 lines
ip/iplink.c +4 -0
 	if (newname && strcmp(dev, newname)) {
+		if (strlen(newname) == 0) {
+		    printf("\"\" is not valid device identifier\n",dev);
+		    return -1;
+		}
 		if (do_changename(dev, newname) < 0)
 			return -1;
 		dev = newname;

Isn't that printf missing somewhere for the 'dev' argument to go?

This is not my patch so I don't know what the original intention was, but now that you point it out I'd say that the dev argument should just be removed.
The new check is for an empty new name.... old name (dev) probably isn't interesting.

I think Alexander Wirt is the original author, lets CC and see if he has a comment...

Signature · 2 lines
Regards,
Andreas Henriksson
#3 lore raw
In reply to Lennart Sorensen

Lennart Sorensen schrieb am Donnerstag, den 11. Oktober 2007:

Quoted 9 lines · Andreas Henriksson
Quoted 8 lines

Patch from debian iproute package.

diff -urNad iproute-20060323~/ip/iplink.c iproute-20060323/ip/iplink.c

ip/iplink.c +0 -0
@@ -384,6 +384,10 @@
 	}
 
Quoted 10 lines

ip/iplink.c line 393

Quoted 8 lines
ip/iplink.c +4 -0
 	if (newname && strcmp(dev, newname)) {
+		if (strlen(newname) == 0) {
+		    printf("\"\" is not valid device identifier\n",dev);
+		    return -1;
+		}
 		if (do_changename(dev, newname) < 0)
 			return -1;
 		dev = newname;

Isn't that printf missing somewhere for the 'dev' argument to go?

Uhm, yes you are right. It don't hurts but its useless, so the 'dev' argument should be removed.

Thanks
Alex

#4 lore raw
In reply to Andreas Henriksson
Quoted 7 lines · On Thu, 11 Oct 2007 20:25:32 +0200 Andreas Henriksson <[email protected]> wrote:

Hello all!

Posting this set of patches again, since there where no reaction last time I sent them.

Regards,
Andreas Henriksson

Since there are so many. Please send them as git separate emails to me and make sure they are in the proper format for importing into git. If you really want to make it easy, just put them in git yourself and then use 'git formatpatch origin' so all the formatting is correct.

The current iproute2 git repository is:
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
(or symlink git://git.kernel.org/pub/network/iproute2/iproute2.git)

Signature · 1 line
Stephen Hemminger <[email protected]>
#5 lore raw
Quoted 4 lines · Stephen Hemminger

Since there are so many. Please send them as git separate emails to me and make sure they are in the proper format for importing into git. If you really want to make it easy, just put them in git yourself and then use 'git formatpatch origin' so all the formatting is correct.

I'm not so great with git, but I'll read up on how to do this and hopefully resend properly tomorrow.
(I'll make sure the patch Len commented on also gets fixed by then.)

Signature · 2 lines
Regards,
Andreas Henriksson
#6 lore raw
In reply to Andreas Henriksson
Quoted 1 line · Andreas Henriksson

Abort flush after 10 seconds.

This should be optional IMO.

Quoted 1 line

Add references to lartc, also drop bogus reference to tc-filters

There's a bad habit of reporting bugs on lartc that belong to netdev, please also make it perfectly clear that lartc is not for bug-reports.

Quoted 17 lines

Fix overflow in time2tick / tick2time.

The helper functions gets passed an unsigned int, which gets cast to long and overflows.

See Debian bug #175462 - http://bugs.debian.org/175462

diff -uri iproute-20070313.orig/tc/tc_core.c iproute-20070313/tc/tc_core.c

tc/tc_core.c +0 -1
@@ -35,12 +35,12 @@
 }
 
 
-long tc_core_time2tick(long time)

tc/tc_core.c line 46

Quoted 10 lines
tc/tc_core.c +2 -1
+unsigned tc_core_time2tick(unsigned time)
 {
 	return time*tick_in_usec;
 }
 
-long tc_core_tick2time(long tick)
+unsigned tc_core_tick2time(unsigned tick)
 {
 	return tick/tick_in_usec;
 }

What about the other functions returning long? I think all of these should be unsigned.

#7 lore raw
Quoted 4 lines · Patrick McHardy
Quoted 1 line · Andreas Henriksson

Abort flush after 10 seconds.

This should be optional IMO.

Copying Alexander Wirt here again, as I think this is his patch. I'll skip this patch in my next resend...

Quoted 5 lines
Quoted 2 lines

Add references to lartc, also drop bogus reference to tc-filters

There's a bad habit of reporting bugs on lartc that belong to netdev, please also make it perfectly clear that lartc is not for bug-reports.

I'll update the patch to mention this.

Quoted 23 lines
Quoted 23 lines

Fix overflow in time2tick / tick2time.

The helper functions gets passed an unsigned int, which gets cast to long and overflows.

See Debian bug #175462 - http://bugs.debian.org/175462

diff -uri iproute-20070313.orig/tc/tc_core.c iproute-20070313/tc/tc_core.c

tc/tc_core.c +1 -1
@@ -35,12 +35,12 @@
 }
 
 
-long tc_core_time2tick(long time)
+unsigned tc_core_time2tick(unsigned time)
 {
 	return time*tick_in_usec;
 }
 
Quoted 8 lines

tc/tc_core.c line 46

Quoted 5 lines
tc/tc_core.c +1 -1
-long tc_core_tick2time(long tick)
+unsigned tc_core_tick2time(unsigned tick)
 {
 	return tick/tick_in_usec;
 }

What about the other functions returning long? I think all of these should be unsigned.

Since I'm no superhacker, I was afraid to touch anything else then the things I could test and this change is what's needed to fix the reported bug. (Actually only one of them was needed IIRC, but it would be stupid to only change one.)
I'll have a look at the other helper functions as well, probably adding a separate patch so that it can be easily dropped if I screw something up there.. :)

I'll also drop the mpath stuff you mentioned in the other mail...

Thanks for reviewing the patches!

Signature · 2 lines
Regards,
Andreas Henriksson
maintainer
#8 lore raw

From: Andreas Henriksson <[email protected]>
Date: Thu, 11 Oct 2007 23:22:12 +0200

Quoted 1 line

Copying Alexander Wirt here again, as I think this is his patch.

It is important that whoever is the package maintainer for an upstream piece of code in any distribution:

1) Completely understands the patches he is applying.

and therefore:

2) When he submits upstream, he doesn't have to wake up 2,000 patch submitters from the dead just to figure out why a change was made.

Neither seems to be occuring here.

#9 lore raw
Quoted 10 lines · David Miller

From: Andreas Henriksson <[email protected]>
Date: Thu, 11 Oct 2007 23:22:12 +0200

Quoted 1 line

Copying Alexander Wirt here again, as I think this is his patch.

It is important that whoever is the package maintainer for an upstream piece of code in any distribution:

1) Completely understands the patches he is applying.

Quoted 7 lines

and therefore:

2) When he submits upstream, he doesn't have to wake up 2,000 patch submitters from the dead just to figure out why a change was made.

Neither seems to be occuring here.

Alexander Wirt is both the Debian package maintainer and (probably) the author of both of the two discussed patches (and only a single person as far as I know). I don't consider it rude to notify him of the comments made about the patches he's been carrying for a long time. While doing a couple of fixes to iproute I thought it would be best to not only submit those but all the patches that has been carried in debian for review upstream and possibly inclusion. The extra review seemed to have been a success so far and I will fix up the patches myself if I have to.

If you want me to STFU please just say so and I'll give you all my sincere appologies and go back to the status quo of no fixes shared with others.

Signature · 2 lines
Regards,
Andreas Henriksson
maintainer
#10 lore raw

From: Andreas Henriksson <[email protected]>
Date: Fri, 12 Oct 2007 00:35:07 +0200

Quoted 3 lines

If you want me to STFU please just say so and I'll give you all my sincere appologies and go back to the status quo of no fixes shared with others.

I applaud your efforts, it's not what the problem is.

I just wonder, therefore, when Alexander planned on submitting this sizable backlog of local iproute2 patches.

#11 lore raw

David Miller schrieb am Donnerstag, den 11. Oktober 2007:

Hi David,

Quoted 8 lines
Quoted 3 lines

If you want me to STFU please just say so and I'll give you all my sincere appologies and go back to the status quo of no fixes shared with others.

I applaud your efforts, it's not what the problem is.

I just wonder, therefore, when Alexander planned on submitting this sizable backlog of local iproute2 patches.

I took over the iproute package when it was in a pretty bad shape, most of the patches submitted were still applied at that time. I ever planed a carefull review of the patches and to submit them later, but due to real life reasons I never got so far. Thanks to Andreas (who will be on of the new maintainers of the package) for doing that for me.

Some of the patches also need some reworking before applying them outside of a distribution. But you are right, it was my fault not to send in the patches and I promise to give more patches back in the future (moving package development to git in the near future will help with that too).

Alex

maintainer
#12 lore raw

From: Alexander Wirt <[email protected]>
Date: Fri, 12 Oct 2007 07:50:54 +0200

Quoted 10 lines

I took over the iproute package when it was in a pretty bad shape, most of the patches submitted were still applied at that time. I ever planed a carefull review of the patches and to submit them later, but due to real life reasons I never got so far. Thanks to Andreas (who will be on of the new maintainers of the package) for doing that for me.

Some of the patches also need some reworking before applying them outside of a distribution. But you are right, it was my fault not to send in the patches and I promise to give more patches back in the future (moving package development to git in the near future will help with that too).

Thanks for explaining the situation, hopefully we'll starighten this all out.

#13 lore raw
In reply to David Miller
Quoted 10 lines · On Thu, 11 Oct 2007 14:48:43 -0700 (PDT) David Miller <[email protected]>…

From: Andreas Henriksson <[email protected]>
Date: Thu, 11 Oct 2007 23:22:12 +0200

Quoted 1 line

Copying Alexander Wirt here again, as I think this is his patch.

It is important that whoever is the package maintainer for an upstream piece of code in any distribution:

1) Completely understands the patches he is applying.

Quoted 7 lines

and therefore:

2) When he submits upstream, he doesn't have to wake up 2,000 patch submitters from the dead just to figure out why a change was made.

Neither seems to be occuring here.

Also, I want the correct author name for legal and technical reasons.

Signature · 1 line
Stephen Hemminger <[email protected]>
#14 lore raw
In reply to Andreas Henriksson
Quoted 17 lines · Andreas Henriksson

Add mpath to ip manpage.

From: Norbert Buchmuller <[email protected]>

The 'mpath' parameter of 'ip route' is not documented in the manual page nor in ip-cref.tex.

...huge part of the text in the patch was taken from the net/ipv4/Kconfig file in the Linux kernel source (2.6.18). I suppose that's OK because both Linux and iproute2 are GPL'd, but I let you know anyway.

See Debian bug #428442 - http://bugs.debian.org/428442

diff -Naur iproute-20061002/doc/ip-cref.tex iproute-20061002.fixed/doc/ip-cref.tex

doc/ip-cref.tex line 1351

Quoted 4 lines
doc/ip-cref.tex +1 -0
@@ -1348,6 +1348,28 @@
 route reflecting its relative bandwidth or quality.
 \end{itemize}
 
+\item \verb|mpath MP_ALGO|

This has been removed from the kernel again because of complete brokeness, so this patch shouldn't be merged.