summaryrefslogtreecommitdiffstats
path: root/openwrt/package/iproute2
diff options
context:
space:
mode:
authorkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-05-27 17:32:43 +0000
committerkaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-05-27 17:32:43 +0000
commit16530342e5f63527dc2e0c78dcaef4f4b68ceb48 (patch)
tree4a73072b3f755b3c43439470896dbbe1c13cc75f /openwrt/package/iproute2
parentb9b0884ae543b5c63539873c9e07d450986d1738 (diff)
upgrade wireless-tools and iproute2
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1084 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/iproute2')
-rw-r--r--openwrt/package/iproute2/Makefile9
-rw-r--r--openwrt/package/iproute2/patches/000-debian_patches_3.patch (renamed from openwrt/package/iproute2/patches/debian-patches-3.patch)1138
-rw-r--r--openwrt/package/iproute2/patches/001-iproute2-2.6.11_Config.patch (renamed from openwrt/package/iproute2/patches/iproute2-2.6.9-Config.patch)0
-rw-r--r--openwrt/package/iproute2/patches/002-iproute2-ipxfrm_no_sctp.patch (renamed from openwrt/package/iproute2/patches/iproute2-ipxfrm_no_sctp.patch)9
-rw-r--r--openwrt/package/iproute2/patches/iproute2-tc-make-fix.patch11
5 files changed, 543 insertions, 624 deletions
diff --git a/openwrt/package/iproute2/Makefile b/openwrt/package/iproute2/Makefile
index ba8d80e05..f7b63f30c 100644
--- a/openwrt/package/iproute2/Makefile
+++ b/openwrt/package/iproute2/Makefile
@@ -3,13 +3,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=iproute2
-PKG_VERSION:=2.6.9
+PKG_VERSION:=2.6.11-050330
PKG_RELEASE:=1
-PKG_MD5SUM:=4b3f335b0139cb909c6a2ae8bf72e548
+PKG_MD5SUM:=e705f26b5ae93e0332e46a3ff15d934
PKG_SOURCE_URL:=http://developer.osdl.org/dev/iproute2/download/
-PKG_SOURCE:=$(PKG_NAME)-2.6.9-041019.tar.gz
-PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-2.6.9
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
PKG_CAT:=zcat
include $(TOPDIR)/package/rules.mk
@@ -30,6 +30,7 @@ $(PKG_BUILD_DIR)/.configured:
touch $@
$(PKG_BUILD_DIR)/.built:
+ $(MAKE) -j1 -C $(PKG_BUILD_DIR)/netem HOSTCC=$(HOSTCC) CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
$(MAKE) -j1 -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include all tc/tc ip/ip
touch $@
diff --git a/openwrt/package/iproute2/patches/debian-patches-3.patch b/openwrt/package/iproute2/patches/000-debian_patches_3.patch
index 8a06f5998..db690d62c 100644
--- a/openwrt/package/iproute2/patches/debian-patches-3.patch
+++ b/openwrt/package/iproute2/patches/000-debian_patches_3.patch
@@ -1,330 +1,39 @@
---- iproute-20041019.orig/ip/Makefile
-+++ iproute-20041019/ip/Makefile
-@@ -6,7 +6,7 @@
- RTMONOBJ=rtmon.o
+diff -Nur iproute2-2.6.11-050330/doc/ip-cref.tex iproute2-2.6.11-050330.new/doc/ip-cref.tex
+--- iproute2-2.6.11-050330/doc/ip-cref.tex 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/doc/ip-cref.tex 2005-05-27 12:13:08.000000000 +0200
+@@ -1322,6 +1322,19 @@
+ If it is not given, Linux uses the value selected with \verb|sysctl|
+ variable \verb|net/ipv4/tcp_reordering|.
- ALLOBJ=$(IPOBJ) $(RTMONOBJ)
--TARGETS=ip rtmon ifcfg rtpr
-+TARGETS=ip rtmon
-
- all: $(TARGETS)
-
---- iproute-20041019.orig/tc/q_htb.c
-+++ iproute-20041019/tc/q_htb.c
-@@ -1,3 +1,311 @@
-+#if 0
-+/*
-+ * q_htb.c HTB.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version
-+ * 2 of the License, or (at your option) any later version.
-+ *
-+ * Authors: Martin Devera, devik@cdi.cz
-+ *
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <syslog.h>
-+#include <fcntl.h>
-+#include <sys/socket.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+#include <string.h>
-+
-+#include "utils.h"
-+#include "tc_util.h"
-+
-+#define HTB_TC_VER 0x30003
-+#if HTB_TC_VER >> 16 != TC_HTB_PROTOVER
-+#error "Different kernel and TC HTB versions"
-+#endif
-+
-+static void explain(void)
-+{
-+ fprintf(stderr, "Usage: ... qdisc add ... htb [default N] [r2q N]\n"
-+ " default minor id of class to which unclassified packets are sent {0}\n"
-+ " r2q DRR quantums are computed as rate in Bps/r2q {10}\n"
-+ " debug string of 16 numbers each 0-3 {0}\n\n"
-+ "... class add ... htb rate R1 burst B1 [prio P] [slot S] [pslot PS]\n"
-+ " [ceil R2] [cburst B2] [mtu MTU] [quantum Q]\n"
-+ " rate rate allocated to this class (class can still borrow)\n"
-+ " burst max bytes burst which can be accumulated during idle period {computed}\n"
-+ " ceil definite upper class rate (no borrows) {rate}\n"
-+ " cburst burst but for ceil {computed}\n"
-+ " mtu max packet size we create rate map for {1600}\n"
-+ " prio priority of leaf; lower are served first {0}\n"
-+ " quantum how much bytes to serve from leaf at once {use r2q}\n"
-+ "\nTC HTB version %d.%d\n",HTB_TC_VER>>16,HTB_TC_VER&0xffff
-+ );
-+}
-+
-+static void explain1(char *arg)
-+{
-+ fprintf(stderr, "Illegal \"%s\"\n", arg);
-+ explain();
-+}
-+
-+
-+#define usage() return(-1)
-+
-+static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
-+{
-+ struct tc_htb_glob opt;
-+ struct rtattr *tail;
-+ unsigned i; char *p;
-+ memset(&opt,0,sizeof(opt));
-+ opt.rate2quantum = 10;
-+ opt.version = 3;
-+
-+ while (argc > 0) {
-+ if (matches(*argv, "r2q") == 0) {
-+ NEXT_ARG();
-+ if (get_u32(&opt.rate2quantum, *argv, 10)) {
-+ explain1("r2q"); return -1;
-+ }
-+ } else if (matches(*argv, "default") == 0) {
-+ NEXT_ARG();
-+ if (get_u32(&opt.defcls, *argv, 16)) {
-+ explain1("default"); return -1;
-+ }
-+ } else if (matches(*argv, "debug") == 0) {
-+ NEXT_ARG(); p = *argv;
-+ for (i=0; i<16; i++,p++) {
-+ if (*p<'0' || *p>'3') break;
-+ opt.debug |= (*p-'0')<<(2*i);
-+ }
-+ } else {
-+ fprintf(stderr, "What is \"%s\"?\n", *argv);
-+ explain();
-+ return -1;
-+ }
-+ argc--; argv++;
-+ }
-+ tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
-+ addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
-+ addattr_l(n, 2024, TCA_HTB_INIT, &opt, NLMSG_ALIGN(sizeof(opt)));
-+ tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
-+ return 0;
-+}
-+
-+static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
-+{
-+ int ok=0;
-+ struct tc_htb_opt opt;
-+ __u32 rtab[256],ctab[256];
-+ unsigned buffer=0,cbuffer=0;
-+ int cell_log=-1,ccell_log = -1,mtu;
-+ struct rtattr *tail;
-+
-+ memset(&opt, 0, sizeof(opt)); mtu = 1600; /* eth packet len */
-+
-+ while (argc > 0) {
-+ if (matches(*argv, "prio") == 0) {
-+ NEXT_ARG();
-+ if (get_u32(&opt.prio, *argv, 10)) {
-+ explain1("prio"); return -1;
-+ }
-+ ok++;
-+ } else if (matches(*argv, "mtu") == 0) {
-+ NEXT_ARG();
-+ if (get_u32(&mtu, *argv, 10)) {
-+ explain1("mtu"); return -1;
-+ }
-+ } else if (matches(*argv, "quantum") == 0) {
-+ NEXT_ARG();
-+ if (get_u32(&opt.quantum, *argv, 10)) {
-+ explain1("quantum"); return -1;
-+ }
-+ } else if (matches(*argv, "burst") == 0 ||
-+ strcmp(*argv, "buffer") == 0 ||
-+ strcmp(*argv, "maxburst") == 0) {
-+ NEXT_ARG();
-+ if (get_size_and_cell(&buffer, &cell_log, *argv) < 0) {
-+ explain1("buffer");
-+ return -1;
-+ }
-+ ok++;
-+ } else if (matches(*argv, "cburst") == 0 ||
-+ strcmp(*argv, "cbuffer") == 0 ||
-+ strcmp(*argv, "cmaxburst") == 0) {
-+ NEXT_ARG();
-+ if (get_size_and_cell(&cbuffer, &ccell_log, *argv) < 0) {
-+ explain1("cbuffer");
-+ return -1;
-+ }
-+ ok++;
-+ } else if (strcmp(*argv, "ceil") == 0) {
-+ NEXT_ARG();
-+ if (opt.ceil.rate) {
-+ fprintf(stderr, "Double \"ceil\" spec\n");
-+ return -1;
-+ }
-+ if (get_rate(&opt.ceil.rate, *argv)) {
-+ explain1("ceil");
-+ return -1;
-+ }
-+ ok++;
-+ } else if (strcmp(*argv, "rate") == 0) {
-+ NEXT_ARG();
-+ if (opt.rate.rate) {
-+ fprintf(stderr, "Double \"rate\" spec\n");
-+ return -1;
-+ }
-+ if (get_rate(&opt.rate.rate, *argv)) {
-+ explain1("rate");
-+ return -1;
-+ }
-+ ok++;
-+ } else if (strcmp(*argv, "help") == 0) {
-+ explain();
-+ return -1;
-+ } else {
-+ fprintf(stderr, "What is \"%s\"?\n", *argv);
-+ explain();
-+ return -1;
-+ }
-+ argc--; argv++;
-+ }
-+
-+/* if (!ok)
-+ return 0;*/
-+
-+ if (opt.rate.rate == 0) {
-+ fprintf(stderr, "\"rate\" is required.\n");
-+ return -1;
-+ }
-+ /* if ceil params are missing, use the same as rate */
-+ if (!opt.ceil.rate) opt.ceil = opt.rate;
-+
-+ /* compute minimal allowed burst from rate; mtu is added here to make
-+ sute that buffer is larger than mtu and to have some safeguard space */
-+ if (!buffer) buffer = opt.rate.rate / HZ + mtu;
-+ if (!cbuffer) cbuffer = opt.ceil.rate / HZ + mtu;
-+
-+ if ((cell_log = tc_calc_rtable(opt.rate.rate, rtab, cell_log, mtu, 0)) < 0) {
-+ fprintf(stderr, "htb: failed to calculate rate table.\n");
-+ return -1;
-+ }
-+ opt.buffer = tc_calc_xmittime(opt.rate.rate, buffer);
-+ opt.rate.cell_log = cell_log;
-+
-+ if ((ccell_log = tc_calc_rtable(opt.ceil.rate, ctab, cell_log, mtu, 0)) < 0) {
-+ fprintf(stderr, "htb: failed to calculate ceil rate table.\n");
-+ return -1;
-+ }
-+ opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, cbuffer);
-+ opt.ceil.cell_log = ccell_log;
-+
-+ tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
-+ addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
-+ addattr_l(n, 2024, TCA_HTB_PARMS, &opt, sizeof(opt));
-+ addattr_l(n, 3024, TCA_HTB_RTAB, rtab, 1024);
-+ addattr_l(n, 4024, TCA_HTB_CTAB, ctab, 1024);
-+ tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
-+ return 0;
-+}
-+
-+static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
-+{
-+ struct rtattr *tb[TCA_HTB_RTAB+1];
-+ struct tc_htb_opt *hopt;
-+ struct tc_htb_glob *gopt;
-+ double buffer,cbuffer;
-+ SPRINT_BUF(b1);
-+ SPRINT_BUF(b2);
-+
-+ if (opt == NULL)
-+ return 0;
-+
-+ memset(tb, 0, sizeof(tb));
-+ parse_rtattr(tb, TCA_HTB_RTAB, RTA_DATA(opt), RTA_PAYLOAD(opt));
-+
-+ if (tb[TCA_HTB_PARMS]) {
-+
-+ hopt = RTA_DATA(tb[TCA_HTB_PARMS]);
-+ if (RTA_PAYLOAD(tb[TCA_HTB_PARMS]) < sizeof(*hopt)) return -1;
-+
-+ if (!hopt->level) {
-+ fprintf(f, "prio %d ", (int)hopt->prio);
-+ if (show_details)
-+ fprintf(f, "quantum %d ", (int)hopt->quantum);
-+ }
-+ fprintf(f, "rate %s ", sprint_rate(hopt->rate.rate, b1));
-+ buffer = ((double)hopt->rate.rate*tc_core_tick2usec(hopt->buffer))/1000000;
-+ fprintf(f, "ceil %s ", sprint_rate(hopt->ceil.rate, b1));
-+ cbuffer = ((double)hopt->ceil.rate*tc_core_tick2usec(hopt->cbuffer))/1000000;
-+ if (show_details) {
-+ fprintf(f, "burst %s/%u mpu %s ", sprint_size(buffer, b1),
-+ 1<<hopt->rate.cell_log, sprint_size(hopt->rate.mpu, b2));
-+ fprintf(f, "cburst %s/%u mpu %s ", sprint_size(cbuffer, b1),
-+ 1<<hopt->ceil.cell_log, sprint_size(hopt->ceil.mpu, b2));
-+ fprintf(f, "level %d ", (int)hopt->level);
-+ } else {
-+ fprintf(f, "burst %s ", sprint_size(buffer, b1));
-+ fprintf(f, "cburst %s ", sprint_size(cbuffer, b1));
-+ }
-+ if (show_raw)
-+ fprintf(f, "buffer [%08x] cbuffer [%08x] ",
-+ hopt->buffer,hopt->cbuffer);
-+ }
-+ if (tb[TCA_HTB_INIT]) {
-+ gopt = RTA_DATA(tb[TCA_HTB_INIT]);
-+ if (RTA_PAYLOAD(tb[TCA_HTB_INIT]) < sizeof(*gopt)) return -1;
-+
-+ fprintf(f, "r2q %d default %x direct_packets_stat %u",
-+ gopt->rate2quantum,gopt->defcls,gopt->direct_pkts);
-+ if (show_details)
-+ fprintf(f," ver %d.%d",gopt->version >> 16,gopt->version & 0xffff);
-+ }
-+ return 0;
-+}
-+
-+static int htb_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats)
-+{
-+ struct tc_htb_xstats *st;
-+ if (xstats == NULL)
-+ return 0;
++\item \verb|hoplimit NUMBER|
+
-+ if (RTA_PAYLOAD(xstats) < sizeof(*st))
-+ return -1;
++--- [2.5.74+ only] Hop limit on the path to this destination. If it is not
++ given, Linux uses the value selected with \verb|sysctl| variable
++ \verb|net/ipv4/ip_default_ttl|.
+
-+ st = RTA_DATA(xstats);
-+ fprintf(f, " lended: %u borrowed: %u giants: %u\n",
-+ st->lends,st->borrows,st->giants);
-+ fprintf(f, " tokens: %d ctokens: %d\n", st->tokens,st->ctokens);
-+ return 0;
-+}
++\item \verb|initcwnd NUMBER|
+
-+struct qdisc_util htb_util = {
-+ NULL,
-+ "htb",
-+ htb_parse_opt,
-+ htb_print_opt,
-+ htb_print_xstats,
-+ htb_parse_class_opt,
-+ htb_print_opt,
-+};
++--- [2.5.70+ only] Initial congestion window size when establishing
++ connections to this destination. This value is multiplied with the
++ MSS (``Maximal Segment Size'') for the connection to get the actual
++ window size. If it is not given (or set to zero), Linux uses the
++ values specified in~\cite{RFC2414}.
+
+
+ \item \verb|nexthop NEXTHOP|
+@@ -2651,6 +2664,9 @@
+ \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.
+
-+/* for testing of old one */
-+struct qdisc_util htb2_util = {
-+ NULL,
-+ "htb2",
-+ htb_parse_opt,
-+ htb_print_opt,
-+ htb_print_xstats,
-+ htb_parse_class_opt,
-+ htb_print_opt,
-+};
-+#endif
- /*
- * q_htb.c HTB.
- *
---- iproute-20041019.orig/doc/Makefile
-+++ iproute-20041019/doc/Makefile
+ \end{thebibliography}
+
+
+diff -Nur iproute2-2.6.11-050330/doc/Makefile iproute2-2.6.11-050330.new/doc/Makefile
+--- iproute2-2.6.11-050330/doc/Makefile 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/doc/Makefile 2005-05-27 12:12:31.000000000 +0200
@@ -14,6 +14,7 @@
PAGESPERPAGE=2
@@ -342,15 +51,7 @@
dvi: $(DVIFILES)
print: $(PSFILES)
-@@ -42,16 +45,17 @@
- done
-
- %.ps: %.dvi
-- $(DVIPS) $< -o $@.tmp
-- ./do-psnup $@.tmp $@ $(PAGESIZE) $(PAGESPERPAGE)
-- rm -f $@.tmp
-+ $(DVIPS) $< -o $@
-
+@@ -47,9 +50,12 @@
%.html: %.sgml
$(SGML2HTML) $<
@@ -364,93 +65,9 @@
clean:
- rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html
+ rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html $(TXTFILES)
---- iproute-20041019.orig/misc/Makefile
-+++ iproute-20041019/misc/Makefile
-@@ -1,7 +1,8 @@
- SSOBJ=ss.o ssfilter.o
- LNSTATOBJ=lnstat.o lnstat_util.o
-
--TARGETS=ss nstat ifstat rtacct arpd lnstat
-+#TARGETS=ss nstat ifstat rtacct arpd lnstat
-+TARGETS=ss nstat rtacct lnstat
-
- include ../Config
-
---- iproute-20041019.orig/misc/netbug
-+++ iproute-20041019/misc/netbug
-@@ -1,23 +1,16 @@
- #! /bin/bash
-
-+set -e
-+
- echo -n "Send network configuration summary to [ENTER means kuznet@ms2.inr.ac.ru] "
- IFS="" read mail || exit 1
- [ -z "$mail" ] && mail=kuznet@ms2.inr.ac.ru
-
-+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"
-
---- iproute-20041019.orig/Makefile
-+++ iproute-20041019/Makefile
-@@ -30,7 +30,7 @@
- LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
-
- all: Config
-- @for i in $(SUBDIRS); \
-+ @set -e; for i in $(SUBDIRS); \
- do $(MAKE) $(MFLAGS) -C $$i; done
-
- Config:
-@@ -45,7 +45,7 @@
- $(DESTDIR)$(DOCDIR)/examples
- install -m 0644 $(shell find examples/diffserv -type f -maxdepth 1) \
- $(DESTDIR)$(DOCDIR)/examples/diffserv
-- @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
-+ @set -e; for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
- install -m 0644 $(shell find etc/iproute2 -type f -maxdepth 1) $(DESTDIR)$(CONFDIR)
- install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
- install -m 0644 $(shell find man/man8 -type f -maxdepth 1) $(DESTDIR)$(MANDIR)/man8
-@@ -53,7 +53,7 @@
- ln -sf $(MANDIR)/man8/tc-pbfifo.8 $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8
-
- clean:
-- @for i in $(SUBDIRS) doc; \
-+ @set -e; for i in $(SUBDIRS) doc; \
- do $(MAKE) $(MFLAGS) -C $$i clean; done
-
- clobber: clean
---- iproute-20041019.orig/include/linux/pkt_sched.h
-+++ iproute-20041019/include/linux/pkt_sched.h
+diff -Nur iproute2-2.6.11-050330/include/linux/pkt_sched.h iproute2-2.6.11-050330.new/include/linux/pkt_sched.h
+--- iproute2-2.6.11-050330/include/linux/pkt_sched.h 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/include/linux/pkt_sched.h 2005-05-27 12:13:08.000000000 +0200
@@ -1,3 +1,409 @@
+#if 0
+#ifndef __LINUX_PKT_SCHED_H
@@ -861,187 +478,7 @@
#ifndef __LINUX_PKT_SCHED_H
#define __LINUX_PKT_SCHED_H
---- iproute-20010824/ip/iproute.c
-+++ iproute-20010824/ip/iproute.c
-@@ -57,7 +57,7 @@
- fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n");
- fprintf(stderr, " [ rtt NUMBER ] [ rttvar NUMBER ]\n");
- fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ ssthresh REALM ]\n");
-- fprintf(stderr, " [ realms REALM ]\n");
-+ fprintf(stderr, " [ realms REALM ] [ hoplimit NUMBER ] [ initcwnd 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");
-@@ -481,6 +481,8 @@
- "cwnd",
- "advmss",
- "reordering",
-+ "hoplimit",
-+ "initcwnd",
- };
- static int hz;
- if (mxrta[i] == NULL)
-@@ -750,6 +752,30 @@
- invarg("\"reordering\" value is invalid\n", *argv);
- rta_addattr32(mxrta, sizeof(mxbuf), RTAX_REORDERING, reord);
- #endif
-+#ifdef RTAX_HOPLIMIT
-+ } else if (strcmp(*argv, "hoplimit") == 0) {
-+ unsigned hoplim;
-+ NEXT_ARG();
-+ if (strcmp(*argv, "lock") == 0) {
-+ mxlock |= (1<<RTAX_HOPLIMIT);
-+ NEXT_ARG();
-+ }
-+ if (get_unsigned(&hoplim, *argv, 0))
-+ invarg("\"hoplimit\" value is invalid\n", *argv);
-+ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplim);
-+#endif
-+#ifdef RTAX_INITCWND
-+ } else if (strcmp(*argv, "initcwnd") == 0) {
-+ unsigned initcwnd;
-+ NEXT_ARG();
-+ if (strcmp(*argv, "lock") == 0) {
-+ mxlock |= (1<<RTAX_HOPLIMIT);
-+ NEXT_ARG();
-+ }
-+ if (get_unsigned(&initcwnd, *argv, 0))
-+ invarg("\"initcwnd\" value is invalid\n", *argv);
-+ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITCWND, initcwnd);
-+#endif
- } else if (strcmp(*argv, "rtt") == 0) {
- unsigned rtt;
- NEXT_ARG();
---- iproute-20010824.orig/doc/ip-cref.tex
-+++ iproute-20010824/doc/ip-cref.tex
-@@ -1324,2 +1324,15 @@
-
-+\item \verb|hoplimit NUMBER|
-+
-+--- [2.5.74+ only] Hop limit on the path to this destination. If it is not
-+ given, Linux uses the value selected with \verb|sysctl| variable
-+ \verb|net/ipv4/ip_default_ttl|.
-+
-+\item \verb|initcwnd NUMBER|
-+
-+--- [2.5.70+ only] Initial congestion window size when establishing
-+ connections to this destination. This value is multiplied with the
-+ MSS (``Maximal Segment Size'') for the connection to get the actual
-+ window size. If it is not given (or set to zero), Linux uses the
-+ values specified in~\cite{RFC2414}.
-
-@@ -2653,2 +2666,5 @@
-
-+\bibitem{RFC2414} M.~Allman, S.~Floyd, C.~Partridge.
-+``Increasing TCP's Initial Window'', RFC-2414.
-+
- \end{thebibliography}
-#! /bin/sh -e
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: add references to lartc
-## DP: also drop bogus reference to tc-filters
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-if [ $# -ne 1 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch $patch_opts -p1 < $0;;
- -unpatch) patch $patch_opts -p1 -R < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1;;
-esac
-
-exit 0
-@DPATCH@
-diff -Nur old/man/man8/ip.8 new/man/man8/ip.8
---- old/man/man8/ip.8 2005-01-05 22:40:29.000000000 +0000
-+++ new/man/man8/ip.8 2005-01-05 22:47:03.000000000 +0000
-@@ -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
-
-diff -Nur old/man/man8/tc.8 new/man/man8/tc.8
---- old/man/man8/tc.8 2004-10-19 20:49:02.000000000 +0000
-+++ new/man/man8/tc.8 2005-01-05 22:46:15.000000000 +0000
-@@ -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 (ahu@ds9a.nl)
-#! /bin/sh -e
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: fixes typo
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-if [ $# -ne 1 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch $patch_opts -p1 < $0;;
- -unpatch) patch $patch_opts -p1 -R < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1;;
-esac
-
-exit 0
-@DPATCH@
---- iproute/ip/iptunnel.c.orig 2003-07-10 11:47:06.000000000 +1000
-+++ iproute/ip/iptunnel.c 2003-07-10 11:47:11.000000000 +1000
-@@ -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");
-#! /bin/sh -e
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: add the wrr qdisc scheduler, see #198414
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-if [ $# -ne 1 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch $patch_opts -p1 < $0;;
- -unpatch) patch $patch_opts -p1 -R < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1;;
-esac
-
-exit 0
-@DPATCH@
-diff -urN iproute-20041019.orig/include/linux/pkt_sched.h iproute-20041019/include/linux/pkt_sched.h
---- iproute-20041019.orig/include/linux/pkt_sched.h 2005-01-06 00:42:42.000000000 +0100
-+++ iproute-20041019/include/linux/pkt_sched.h 2005-01-06 00:38:06.000000000 +0100
-@@ -837,4 +837,116 @@
+@@ -451,4 +857,116 @@
#define NETEM_DIST_SCALE 8192
@@ -1158,9 +595,185 @@ diff -urN iproute-20041019.orig/include/linux/pkt_sched.h iproute-20041019/inclu
+};
+
#endif
-diff -urN iproute-20041019.orig/tc/Makefile iproute-20041019/tc/Makefile
---- iproute-20041019.orig/tc/Makefile 2004-10-19 22:49:02.000000000 +0200
-+++ iproute-20041019/tc/Makefile 2005-01-06 00:33:47.000000000 +0100
+diff -Nur iproute2-2.6.11-050330/ip/iproute.c iproute2-2.6.11-050330.new/ip/iproute.c
+--- iproute2-2.6.11-050330/ip/iproute.c 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/ip/iproute.c 2005-05-27 12:22:30.000000000 +0200
+@@ -58,7 +58,7 @@
+ fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n");
+ fprintf(stderr, " [ rtt NUMBER ] [ rttvar NUMBER ]\n");
+ fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ ssthresh NUMBER ]\n");
+- fprintf(stderr, " [ realms REALM ]\n");
++ fprintf(stderr, " [ realms REALM ] [ hoplimit NUMBER ] [ initcwnd 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");
+@@ -478,6 +478,8 @@
+ "cwnd",
+ "advmss",
+ "reordering",
++ "hoplimit",
++ "initcwnd",
+ };
+ static int hz;
+ if (mxrta[i] == NULL)
+@@ -746,6 +748,30 @@
+ invarg("\"reordering\" value is invalid\n", *argv);
+ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_REORDERING, reord);
+ #endif
++#ifdef RTAX_HOPLIMIT
++ } else if (strcmp(*argv, "hoplimit") == 0) {
++ unsigned hoplim;
++ NEXT_ARG();
++ if (strcmp(*argv, "lock") == 0) {
++ mxlock |= (1<<RTAX_HOPLIMIT);
++ NEXT_ARG();
++ }
++ if (get_unsigned(&hoplim, *argv, 0))
++ invarg("\"hoplimit\" value is invalid\n", *argv);
++ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplim);
++#endif
++#ifdef RTAX_INITCWND
++ } else if (strcmp(*argv, "initcwnd") == 0) {
++ unsigned initcwnd;
++ NEXT_ARG();
++ if (strcmp(*argv, "lock") == 0) {
++ mxlock |= (1<<RTAX_HOPLIMIT);
++ NEXT_ARG();
++ }
++ if (get_unsigned(&initcwnd, *argv, 0))
++ invarg("\"initcwnd\" value is invalid\n", *argv);
++ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITCWND, initcwnd);
++#endif
+ } else if (strcmp(*argv, "rtt") == 0) {
+ unsigned rtt;
+ NEXT_ARG();
+diff -Nur iproute2-2.6.11-050330/ip/iptunnel.c iproute2-2.6.11-050330.new/ip/iptunnel.c
+--- iproute2-2.6.11-050330/ip/iptunnel.c 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/ip/iptunnel.c 2005-05-27 12:13:08.000000000 +0200
+@@ -225,7 +225,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");
+diff -Nur iproute2-2.6.11-050330/Makefile iproute2-2.6.11-050330.new/Makefile
+--- iproute2-2.6.11-050330/Makefile 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/Makefile 2005-05-27 12:16:13.000000000 +0200
+@@ -31,7 +31,7 @@
+ LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
+
+ all: Config
+- @for i in $(SUBDIRS); \
++ @set -e; for i in $(SUBDIRS); \
+ do $(MAKE) $(MFLAGS) -C $$i; done
+
+ Config:
+@@ -46,7 +46,7 @@
+ $(DESTDIR)$(DOCDIR)/examples
+ install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
+ $(DESTDIR)$(DOCDIR)/examples/diffserv
+- @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
++ @set -e; for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
+ install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
+ install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
+ install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8
+@@ -56,7 +56,7 @@
+ install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3
+
+ clean:
+- @for i in $(SUBDIRS) doc; \
++ @set -e; for i in $(SUBDIRS) doc; \
+ do $(MAKE) $(MFLAGS) -C $$i clean; done
+
+ clobber: clean
+diff -Nur iproute2-2.6.11-050330/man/man8/ip.8 iproute2-2.6.11-050330.new/man/man8/ip.8
+--- iproute2-2.6.11-050330/man/man8/ip.8 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/man/man8/ip.8 2005-05-27 12:13:08.000000000 +0200
+@@ -1805,6 +1805,8 @@
+ .RB "IP Command reference " ip-cref.ps
+ .br
+ .RB "IP tunnels " ip-cref.ps
++.br
++.RB http://lartc.org/
+
+ .SH AUTHOR
+ Original Manpage by Michail Litvak <mci@owl.openwall.com>
+diff -Nur iproute2-2.6.11-050330/man/man8/tc.8 iproute2-2.6.11-050330.new/man/man8/tc.8
+--- iproute2-2.6.11-050330/man/man8/tc.8 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/man/man8/tc.8 2005-05-27 12:13:08.000000000 +0200
+@@ -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 (ahu@ds9a.nl)
+diff -Nur iproute2-2.6.11-050330/misc/Makefile iproute2-2.6.11-050330.new/misc/Makefile
+--- iproute2-2.6.11-050330/misc/Makefile 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/misc/Makefile 2005-05-27 12:13:08.000000000 +0200
+@@ -1,7 +1,8 @@
+ SSOBJ=ss.o ssfilter.o
+ LNSTATOBJ=lnstat.o lnstat_util.o
+
+-TARGETS=ss nstat ifstat rtacct arpd lnstat
++#TARGETS=ss nstat ifstat rtacct arpd lnstat
++TARGETS=ss nstat rtacct lnstat
+
+ include ../Config
+
+diff -Nur iproute2-2.6.11-050330/misc/netbug iproute2-2.6.11-050330.new/misc/netbug
+--- iproute2-2.6.11-050330/misc/netbug 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/misc/netbug 2005-05-27 12:13:08.000000000 +0200
+@@ -1,23 +1,16 @@
+ #! /bin/bash
+
++set -e
++
+ echo -n "Send network configuration summary to [ENTER means kuznet@ms2.inr.ac.ru] "
+ IFS="" read mail || exit 1
+ [ -z "$mail" ] && mail=kuznet@ms2.inr.ac.ru
+
++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"
+
+diff -Nur iproute2-2.6.11-050330/tc/Makefile iproute2-2.6.11-050330.new/tc/Makefile
+--- iproute2-2.6.11-050330/tc/Makefile 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/tc/Makefile 2005-05-27 12:13:08.000000000 +0200
@@ -10,6 +10,7 @@
TCMODULES += q_prio.o
TCMODULES += q_tbf.o
@@ -1169,9 +782,324 @@ diff -urN iproute-20041019.orig/tc/Makefile iproute-20041019/tc/Makefile
TCMODULES += f_rsvp.o
TCMODULES += f_u32.o
TCMODULES += f_route.o
-diff -urN iproute-20041019.orig/tc/q_wrr.c iproute-20041019/tc/q_wrr.c
---- iproute-20041019.orig/tc/q_wrr.c 1970-01-01 01:00:00.000000000 +0100
-+++ iproute-20041019/tc/q_wrr.c 2005-01-06 00:34:06.000000000 +0100
+diff -Nur iproute2-2.6.11-050330/tc/q_htb.c iproute2-2.6.11-050330.new/tc/q_htb.c
+--- iproute2-2.6.11-050330/tc/q_htb.c 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/tc/q_htb.c 2005-05-27 12:13:08.000000000 +0200
+@@ -1,3 +1,311 @@
++#if 0
++/*
++ * q_htb.c HTB.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version
++ * 2 of the License, or (at your option) any later version.
++ *
++ * Authors: Martin Devera, devik@cdi.cz
++ *
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <syslog.h>
++#include <fcntl.h>
++#include <sys/socket.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <string.h>
++
++#include "utils.h"
++#include "tc_util.h"
++
++#define HTB_TC_VER 0x30003
++#if HTB_TC_VER >> 16 != TC_HTB_PROTOVER
++#error "Different kernel and TC HTB versions"
++#endif
++
++static void explain(void)
++{
++ fprintf(stderr, "Usage: ... qdisc add ... htb [default N] [r2q N]\n"
++ " default minor id of class to which unclassified packets are sent {0}\n"
++ " r2q DRR quantums are computed as rate in Bps/r2q {10}\n"
++ " debug string of 16 numbers each 0-3 {0}\n\n"
++ "... class add ... htb rate R1 burst B1 [prio P] [slot S] [pslot PS]\n"
++ " [ceil R2] [cburst B2] [mtu MTU] [quantum Q]\n"
++ " rate rate allocated to this class (class can still borrow)\n"
++ " burst max bytes burst which can be accumulated during idle period {computed}\n"
++ " ceil definite upper class rate (no borrows) {rate}\n"
++ " cburst burst but for ceil {computed}\n"
++ " mtu max packet size we create rate map for {1600}\n"
++ " prio priority of leaf; lower are served first {0}\n"
++ " quantum how much bytes to serve from leaf at once {use r2q}\n"
++ "\nTC HTB version %d.%d\n",HTB_TC_VER>>16,HTB_TC_VER&0xffff
++ );
++}
++
++static void explain1(char *arg)
++{
++ fprintf(stderr, "Illegal \"%s\"\n", arg);
++ explain();
++}
++
++
++#define usage() return(-1)
++
++static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
++{
++ struct tc_htb_glob opt;
++ struct rtattr *tail;
++ unsigned i; char *p;
++ memset(&opt,0,sizeof(opt));
++ opt.rate2quantum = 10;
++ opt.version = 3;
++
++ while (argc > 0) {
++ if (matches(*argv, "r2q") == 0) {
++ NEXT_ARG();
++ if (get_u32(&opt.rate2quantum, *argv, 10)) {
++ explain1("r2q"); return -1;
++ }
++ } else if (matches(*argv, "default") == 0) {
++ NEXT_ARG();
++ if (get_u32(&opt.defcls, *argv, 16)) {
++ explain1("default"); return -1;
++ }
++ } else if (matches(*argv, "debug") == 0) {
++ NEXT_ARG(); p = *argv;
++ for (i=0; i<16; i++,p++) {
++ if (*p<'0' || *p>'3') break;
++ opt.debug |= (*p-'0')<<(2*i);
++ }
++ } else {
++ fprintf(stderr, "What is \"%s\"?\n", *argv);
++ explain();
++ return -1;
++ }
++ argc--; argv++;
++ }
++ tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
++ addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
++ addattr_l(n, 2024, TCA_HTB_INIT, &opt, NLMSG_ALIGN(sizeof(opt)));
++ tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
++ return 0;
++}
++
++static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
++{
++ int ok=0;
++ struct tc_htb_opt opt;
++ __u32 rtab[256],ctab[256];
++ unsigned buffer=0,cbuffer=0;
++ int cell_log=-1,ccell_log = -1,mtu;
++ struct rtattr *tail;
++
++ memset(&opt, 0, sizeof(opt)); mtu = 1600; /* eth packet len */
++
++ while (argc > 0) {
++ if (matches(*argv, "prio") == 0) {
++ NEXT_ARG();
++ if (get_u32(&opt.prio, *argv, 10)) {
++ explain1("prio"); return -1;
++ }
++ ok++;
++ } else if (matches(*argv, "mtu") == 0) {
++ NEXT_ARG();
++ if (get_u32(&mtu, *argv, 10)) {
++ explain1("mtu"); return -1;
++ }
++ } else if (matches(*argv, "quantum") == 0) {
++ NEXT_ARG();
++ if (get_u32(&opt.quantum, *argv, 10)) {
++ explain1("quantum"); return -1;
++ }
++ } else if (matches(*argv, "burst") == 0 ||
++ strcmp(*argv, "buffer") == 0 ||
++ strcmp(*argv, "maxburst") == 0) {
++ NEXT_ARG();
++ if (get_size_and_cell(&buffer, &cell_log, *argv) < 0) {
++ explain1("buffer");
++ return -1;
++ }
++ ok++;
++ } else if (matches(*argv, "cburst") == 0 ||
++ strcmp(*argv, "cbuffer") == 0 ||
++ strcmp(*argv, "cmaxburst") == 0) {
++ NEXT_ARG();
++ if (get_size_and_cell(&cbuffer, &ccell_log, *argv) < 0) {
++ explain1("cbuffer");
++ return -1;
++ }
++ ok++;
++ } else if (strcmp(*argv, "ceil") == 0) {
++ NEXT_ARG();
++ if (opt.ceil.rate) {
++ fprintf(stderr, "Double \"ceil\" spec\n");
++ return -1;
++ }
++ if (get_rate(&opt.ceil.rate, *argv)) {
++ explain1("ceil");
++ return -1;
++ }
++ ok++;
++ } else if (strcmp(*argv, "rate") == 0) {
++ NEXT_ARG();
++ if (opt.rate.rate) {
++ fprintf(stderr, "Double \"rate\" spec\n");
++ return -1;
++ }
++ if (get_rate(&opt.rate.rate, *argv)) {
++ explain1("rate");
++ return -1;
++ }
++ ok++;
++ } else if (strcmp(*argv, "help") == 0) {
++ explain();
++ return -1;
++ } else {
++ fprintf(stderr, "What is \"%s\"?\n", *argv);
++ explain();
++ return -1;
++ }
++ argc--; argv++;
++ }
++
++/* if (!ok)
++ return 0;*/
++
++ if (opt.rate.rate == 0) {
++ fprintf(stderr, "\"rate\" is required.\n");
++ return -1;
++ }
++ /* if ceil params are missing, use the same as rate */
++ if (!opt.ceil.rate) opt.ceil = opt.rate;
++
++ /* compute minimal allowed burst from rate; mtu is added here to make
++ sute that buffer is larger than mtu and to have some safeguard space */
++ if (!buffer) buffer = opt.rate.rate / HZ + mtu;
++ if (!cbuffer) cbuffer = opt.ceil.rate / HZ + mtu;
++
++ if ((cell_log = tc_calc_rtable(opt.rate.rate, rtab, cell_log, mtu, 0)) < 0) {
++ fprintf(stderr, "htb: failed to calculate rate table.\n");
++ return -1;
++ }
++ opt.buffer = tc_calc_xmittime(opt.rate.rate, buffer);
++ opt.rate.cell_log = cell_log;
++
++ if ((ccell_log = tc_calc_rtable(opt.ceil.rate, ctab, cell_log, mtu, 0)) < 0) {
++ fprintf(stderr, "htb: failed to calculate ceil rate table.\n");
++ return -1;
++ }
++ opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, cbuffer);
++ opt.ceil.cell_log = ccell_log;
++
++ tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
++ addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
++ addattr_l(n, 2024, TCA_HTB_PARMS, &opt, sizeof(opt));
++ addattr_l(n, 3024, TCA_HTB_RTAB, rtab, 1024);
++ addattr_l(n, 4024, TCA_HTB_CTAB, ctab, 1024);
++ tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
++ return 0;
++}
++
++static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
++{
++ struct rtattr *tb[TCA_HTB_RTAB+1];
++ struct tc_htb_opt *hopt;
++ struct tc_htb_glob *gopt;
++ double buffer,cbuffer;
++ SPRINT_BUF(b1);
++ SPRINT_BUF(b2);
++
++ if (opt == NULL)
++ return 0;
++
++ memset(tb, 0, sizeof(tb));
++ parse_rtattr(tb, TCA_HTB_RTAB, RTA_DATA(opt), RTA_PAYLOAD(opt));
++
++ if (tb[TCA_HTB_PARMS]) {
++
++ hopt = RTA_DATA(tb[TCA_HTB_PARMS]);
++ if (RTA_PAYLOAD(tb[TCA_HTB_PARMS]) < sizeof(*hopt)) return -1;
++
++ if (!hopt->level) {
++ fprintf(f, "prio %d ", (int)hopt->prio);
++ if (show_details)
++ fprintf(f, "quantum %d ", (int)hopt->quantum);
++ }
++ fprintf(f, "rate %s ", sprint_rate(hopt->rate.rate, b1));
++ buffer = ((double)hopt->rate.rate*tc_core_tick2usec(hopt->buffer))/1000000;
++ fprintf(f, "ceil %s ", sprint_rate(hopt->ceil.rate, b1));
++ cbuffer = ((double)hopt->ceil.rate*tc_core_tick2usec(hopt->cbuffer))/1000000;
++ if (show_details) {
++ fprintf(f, "burst %s/%u mpu %s ", sprint_size(buffer, b1),
++ 1<<hopt->rate.cell_log, sprint_size(hopt->rate.mpu, b2));
++ fprintf(f, "cburst %s/%u mpu %s ", sprint_size(cbuffer, b1),
++ 1<<hopt->ceil.cell_log, sprint_size(hopt->ceil.mpu, b2));
++ fprintf(f, "level %d ", (int)hopt->level);
++ } else {
++ fprintf(f, "burst %s ", sprint_size(buffer, b1));
++ fprintf(f, "cburst %s ", sprint_size(cbuffer, b1));
++ }
++ if (show_raw)
++ fprintf(f, "buffer [%08x] cbuffer [%08x] ",
++ hopt->buffer,hopt->cbuffer);
++ }
++ if (tb[TCA_HTB_INIT]) {
++ gopt = RTA_DATA(tb[TCA_HTB_INIT]);
++ if (RTA_PAYLOAD(tb[TCA_HTB_INIT]) < sizeof(*gopt)) return -1;
++
++ fprintf(f, "r2q %d default %x direct_packets_stat %u",
++ gopt->rate2quantum,gopt->defcls,gopt->direct_pkts);
++ if (show_details)
++ fprintf(f," ver %d.%d",gopt->version >> 16,gopt->version & 0xffff);
++ }
++ return 0;
++}
++
++static int htb_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats)
++{
++ struct tc_htb_xstats *st;
++ if (xstats == NULL)
++ return 0;
++
++ if (RTA_PAYLOAD(xstats) < sizeof(*st))
++ return -1;
++
++ st = RTA_DATA(xstats);
++ fprintf(f, " lended: %u borrowed: %u giants: %u\n",
++ st->lends,st->borrows,st->giants);
++ fprintf(f, " tokens: %d ctokens: %d\n", st->tokens,st->ctokens);
++ return 0;
++}
++
++struct qdisc_util htb_util = {
++ NULL,
++ "htb",
++ htb_parse_opt,
++ htb_print_opt,
++ htb_print_xstats,
++ htb_parse_class_opt,
++ htb_print_opt,
++};
++
++/* for testing of old one */
++struct qdisc_util htb2_util = {
++ NULL,
++ "htb2",
++ htb_parse_opt,
++ htb_print_opt,
++ htb_print_xstats,
++ htb_parse_class_opt,
++ htb_print_opt,
++};
++#endif
+ /*
+ * q_htb.c HTB.
+ *
+diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.c
+--- iproute2-2.6.11-050330/tc/q_wrr.c 1970-01-01 01:00:00.000000000 +0100
++++ iproute2-2.6.11-050330.new/tc/q_wrr.c 2005-05-27 12:13:08.000000000 +0200
@@ -0,0 +1,322 @@
+#include <stdio.h>
+#include <stdlib.h>
diff --git a/openwrt/package/iproute2/patches/iproute2-2.6.9-Config.patch b/openwrt/package/iproute2/patches/001-iproute2-2.6.11_Config.patch
index c1491f455..c1491f455 100644
--- a/openwrt/package/iproute2/patches/iproute2-2.6.9-Config.patch
+++ b/openwrt/package/iproute2/patches/001-iproute2-2.6.11_Config.patch
diff --git a/openwrt/package/iproute2/patches/iproute2-ipxfrm_no_sctp.patch b/openwrt/package/iproute2/patches/002-iproute2-ipxfrm_no_sctp.patch
index b35b72df7..34eaeb055 100644
--- a/openwrt/package/iproute2/patches/iproute2-ipxfrm_no_sctp.patch
+++ b/openwrt/package/iproute2/patches/002-iproute2-ipxfrm_no_sctp.patch
@@ -1,6 +1,7 @@
---- iproute2-2.6.9.old/ip/ipxfrm.c 2005-01-30 19:09:32.000000000 +0100
-+++ iproute2-2.6.9/ip/ipxfrm.c 2005-01-30 19:10:31.000000000 +0100
-@@ -392,7 +392,6 @@
+diff -Nur iproute2-2.6.11-050330/ip/ipxfrm.c iproute2-2.6.11-050330.new/ip/ipxfrm.c
+--- iproute2-2.6.11-050330/ip/ipxfrm.c 2005-04-01 21:58:11.000000000 +0200
++++ iproute2-2.6.11-050330.new/ip/ipxfrm.c 2005-05-27 12:27:44.000000000 +0200
+@@ -444,7 +444,6 @@
switch (sel->proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
@@ -8,7 +9,7 @@
default: /* XXX */
if (sel->sport_mask)
fprintf(fp, "sport %u ", ntohs(sel->sport));
-@@ -787,7 +786,6 @@
+@@ -998,7 +997,6 @@
switch (sel->proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
diff --git a/openwrt/package/iproute2/patches/iproute2-tc-make-fix.patch b/openwrt/package/iproute2/patches/iproute2-tc-make-fix.patch
deleted file mode 100644
index 322c2bc83..000000000
--- a/openwrt/package/iproute2/patches/iproute2-tc-make-fix.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- iproute-2.6.9.old/tc/Makefile 2005-01-30 18:53:59.000000000 +0100
-+++ iproute-2.6.9/tc/Makefile 2005-01-30 18:54:07.000000000 +0100
-@@ -52,7 +52,7 @@
- ./$* >$@
- rm $*
-
--all: libtc.a tc $(TCSO) $(NETEM_DIST)
-+all: libtc.a tc $(TCSO)
-
- tc: $(TCOBJ) $(LIBNETLINK) $(LIBUTIL) $(TCLIB)
-