[ar71xx] remove remaining references to dev-ap91-eth.h, patch by Stijn Tintel
[openwrt.git] / package / iproute2 / patches / 000-debian_patches_3.patch
index db690d6..3c2debc 100644 (file)
@@ -1,9 +1,20 @@
-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|.
+---
+ Makefile                  |    4 
+ doc/Makefile              |    8 
+ doc/ip-cref.tex           |   16 +
+ include/linux/pkt_sched.h |  518 ++++++++++++++++++++++++++++++++++++++++++++++
+ ip/iptunnel.c             |    2 
+ misc/Makefile             |    3 
+ tc/Makefile               |    1 
+ tc/q_htb.c                |  308 +++++++++++++++++++++++++++
+ tc/q_wrr.c                |  322 ++++++++++++++++++++++++++++
+ 9 files changed, 1177 insertions(+), 5 deletions(-)
+
+--- iproute2-2.6.35.orig/doc/ip-cref.tex
++++ iproute2-2.6.35/doc/ip-cref.tex
+@@ -1307,6 +1307,19 @@ peers are allowed to send to us.
+ --- \threeonly the clamp for congestion window. It is ignored if the \verb|lock|
+     flag is not used.
  
 +\item \verb|hoplimit NUMBER|
 +
@@ -19,22 +30,21 @@ diff -Nur iproute2-2.6.11-050330/doc/ip-cref.tex iproute2-2.6.11-050330.new/doc/
 +    window size. If it is not given (or set to zero), Linux uses the
 +    values specified in~\cite{RFC2414}.
  
+ \item \verb|advmss NUMBER|
  
- \item \verb|nexthop NEXTHOP|
-@@ -2651,6 +2664,9 @@
- \bibitem{RFC-DHCP} R.~Droms.
- ``Dynamic Host Configuration Protocol.'', RFC-2131
+@@ -2664,6 +2677,9 @@ http://www.cisco.com/univercd/cc/td/doc/
  
+ \bibitem{RFC2414}  M.~Allman, S.~Floyd, C.~Partridge.
+ ``Increasing TCP's Initial Window'', RFC-2414.
++
 +\bibitem{RFC2414}  M.~Allman, S.~Floyd, C.~Partridge.
 +``Increasing TCP's Initial Window'', RFC-2414.
-+
- \end{thebibliography}
  
+ \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 @@
+--- iproute2-2.6.35.orig/doc/Makefile
++++ iproute2-2.6.35/doc/Makefile
+@@ -14,6 +14,7 @@ PAGESIZE=a4
  PAGESPERPAGE=2
  
  HTMLFILES=$(subst .sgml,.html,$(shell echo *.sgml))
@@ -42,7 +52,7 @@ diff -Nur iproute2-2.6.11-050330/doc/Makefile iproute2-2.6.11-050330.new/doc/Mak
  DVIFILES=$(subst .ps,.dvi,$(PSFILES))
  
  
-@@ -23,6 +24,8 @@
+@@ -23,6 +24,8 @@ pstwocol: $(PSFILES)
  
  html: $(HTMLFILES)
  
@@ -51,7 +61,7 @@ diff -Nur iproute2-2.6.11-050330/doc/Makefile iproute2-2.6.11-050330.new/doc/Mak
  dvi: $(DVIFILES)
  
  print: $(PSFILES)
-@@ -47,9 +50,12 @@
+@@ -47,9 +50,12 @@ print: $(PSFILES)
  %.html: %.sgml
        $(SGML2HTML) $<
  
@@ -65,9 +75,8 @@ diff -Nur iproute2-2.6.11-050330/doc/Makefile iproute2-2.6.11-050330.new/doc/Mak
  clean:
 -      rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html
 +      rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html $(TXTFILES)
-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
+--- iproute2-2.6.35.orig/include/linux/pkt_sched.h
++++ iproute2-2.6.35/include/linux/pkt_sched.h
 @@ -1,3 +1,409 @@
 +#if 0
 +#ifndef __LINUX_PKT_SCHED_H
@@ -291,19 +300,19 @@ diff -Nur iproute2-2.6.11-050330/include/linux/pkt_sched.h iproute2-2.6.11-05033
 +#define TCA_SET_OFF TCA_GRED_PARMS
 +struct tc_gred_qopt
 +{
-+       __u32           limit;          /* HARD maximal queue length (bytes)    
++       __u32           limit;          /* HARD maximal queue length (bytes)
 +*/
-+       __u32           qth_min;        /* Min average length threshold (bytes) 
++       __u32           qth_min;        /* Min average length threshold (bytes)
 +*/
-+       __u32           qth_max;        /* Max average length threshold (bytes) 
++       __u32           qth_max;        /* Max average length threshold (bytes)
 +*/
 +       __u32           DP;             /* upto 2^32 DPs */
-+       __u32           backlog;        
-+       __u32           qave;   
-+       __u32           forced; 
-+       __u32           early;  
-+       __u32           other;  
-+       __u32           pdrop;  
++       __u32           backlog;
++       __u32           qave;
++       __u32           forced;
++       __u32           early;
++       __u32           other;
++       __u32           pdrop;
 +
 +       unsigned char   Wlog;           /* log(W)               */
 +       unsigned char   Plog;           /* log(P_max/(qth_max-qth_min)) */
@@ -478,9 +487,9 @@ diff -Nur iproute2-2.6.11-050330/include/linux/pkt_sched.h iproute2-2.6.11-05033
  #ifndef __LINUX_PKT_SCHED_H
  #define __LINUX_PKT_SCHED_H
  
-@@ -451,4 +857,116 @@
- #define NETEM_DIST_SCALE      8192
+@@ -481,4 +887,116 @@ struct tc_drr_stats {
+       __u32   deficit;
+ };
  
 +/* WRR section */
 +
@@ -595,83 +604,20 @@ diff -Nur iproute2-2.6.11-050330/include/linux/pkt_sched.h iproute2-2.6.11-05033
 +};
 +
  #endif
-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;
+--- iproute2-2.6.35.orig/ip/iptunnel.c
++++ iproute2-2.6.35/ip/iptunnel.c
+@@ -130,7 +130,7 @@ static int parse_args(int argc, char **a
                        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;
+                       p->o_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 @@
+                                       fprintf(stderr, "invalid value of \"okey\"\n");
+--- iproute2-2.6.35.orig/Makefile
++++ iproute2-2.6.35/Makefile
+@@ -57,7 +57,7 @@ install: all
                $(DESTDIR)$(DOCDIR)/examples
        install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
                $(DESTDIR)$(DOCDIR)/examples/diffserv
@@ -680,42 +626,17 @@ diff -Nur iproute2-2.6.11-050330/Makefile iproute2-2.6.11-050330.new/Makefile
        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
+@@ -75,7 +75,7 @@ snapshot:
  
  clean:
+       rm -f cscope.*
 -      @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
+--- iproute2-2.6.35.orig/misc/Makefile
++++ iproute2-2.6.35/misc/Makefile
 @@ -1,7 +1,8 @@
  SSOBJ=ss.o ssfilter.o
  LNSTATOBJ=lnstat.o lnstat_util.o
@@ -726,65 +647,18 @@ diff -Nur iproute2-2.6.11-050330/misc/Makefile iproute2-2.6.11-050330.new/misc/M
  
  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
- TCMODULES += q_cbq.o
+--- iproute2-2.6.35.orig/tc/Makefile
++++ iproute2-2.6.35/tc/Makefile
+@@ -15,6 +15,7 @@ TCMODULES += q_cbq.o
+ TCMODULES += q_rr.o
+ TCMODULES += q_multiq.o
+ TCMODULES += q_netem.o
 +TCMODULES += q_wrr.o
  TCMODULES += f_rsvp.o
  TCMODULES += f_u32.o
  TCMODULES += f_route.o
-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
+--- iproute2-2.6.35.orig/tc/q_htb.c
++++ iproute2-2.6.35/tc/q_htb.c
 @@ -1,3 +1,311 @@
 +#if 0
 +/*
@@ -985,7 +859,7 @@ diff -Nur iproute2-2.6.11-050330/tc/q_htb.c iproute2-2.6.11-050330.new/tc/q_htb.
 +      }
 +      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;
@@ -1042,14 +916,14 @@ diff -Nur iproute2-2.6.11-050330/tc/q_htb.c iproute2-2.6.11-050330.new/tc/q_htb.
 +              fprintf(f, "cburst %s ", sprint_size(cbuffer, b1));
 +          }
 +          if (show_raw)
-+              fprintf(f, "buffer [%08x] cbuffer [%08x] ", 
++              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", 
++          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);
@@ -1067,7 +941,7 @@ diff -Nur iproute2-2.6.11-050330/tc/q_htb.c iproute2-2.6.11-050330.new/tc/q_htb.
 +              return -1;
 +
 +      st = RTA_DATA(xstats);
-+      fprintf(f, " lended: %u borrowed: %u giants: %u\n", 
++      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;
@@ -1097,9 +971,8 @@ diff -Nur iproute2-2.6.11-050330/tc/q_htb.c iproute2-2.6.11-050330.new/tc/q_htb.
  /*
   * 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
+--- /dev/null
++++ iproute2-2.6.35/tc/q_wrr.c
 @@ -0,0 +1,322 @@
 +#include <stdio.h>
 +#include <stdlib.h>
@@ -1118,16 +991,16 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +#define usage() return(-1)
 +
 +// Returns -1 on error
-+static int wrr_parse_qdisc_weight(int argc, char** argv, 
++static int wrr_parse_qdisc_weight(int argc, char** argv,
 +                              struct tc_wrr_qdisc_modf* opt) {
 +  int i;
-+  
++
 +  opt->weight1.weight_mode=-1;
 +  opt->weight2.weight_mode=-1;
-+  
-+  for(i=0; i<argc; i++) {  
++
++  for(i=0; i<argc; i++) {
 +    if(!memcmp(argv[i],"wmode1=",7)) {
-+      opt->weight1.weight_mode=atoi(argv[i]+7);            
++      opt->weight1.weight_mode=atoi(argv[i]+7);
 +    } else if(!memcmp(argv[i],"wmode2=",7)) {
 +      opt->weight2.weight_mode=atoi(argv[i]+7);
 +    } else {
@@ -1138,16 +1011,16 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +  return 0;
 +}
 +
-+static int wrr_parse_class_modf(int argc, char** argv, 
++static int wrr_parse_class_modf(int argc, char** argv,
 +                                struct tc_wrr_class_modf* modf) {
 +  int i;
-+  
++
 +  if(argc<1) {
 +    fprintf(stderr, "Usage: ... [weight1=val] [decr1=val] [incr1=val] [min1=val] [max1=val] [val2=val] ...\n");
 +    fprintf(stderr, "  The values can be floating point like 0.42 or divisions like 42/100\n");
 +    return -1;
 +  }
-+  
++
 +  // Set meaningless values:
 +  modf->weight1.val=0;
 +  modf->weight1.decr=(__u64)-1;
@@ -1159,7 +1032,7 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +  modf->weight2.incr=(__u64)-1;
 +  modf->weight2.min=0;
 +  modf->weight2.max=0;
-+  
++
 +  // And read values:
 +  for(i=0; i<argc; i++) {
 +    char arg[80];
@@ -1170,29 +1043,29 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +      return -1;
 +    }
 +    strcpy(arg,argv[i]);
-+    
++
 +    name=strtok(arg,"=");
 +    if(name) value1=strtok(0,"/");
 +    if(value1) value2=strtok(0,"");
-+    
++
 +    if(!value1) {
 +      fprintf(stderr,"No = found in argument: %s\n",argv[i]);
 +      return -1;
 +    }
-+    
++
 +    f_val1=atof(value1);
-+    if(value2) f_val2=atof(value2);    
-+    
++    if(value2) f_val2=atof(value2);
++
 +    if(f_val2==0)  {
 +      fprintf(stderr,"Division by 0\n");
 +      return -1;
 +    }
-+        
-+    value=f_val1/f_val2;    
++
++    value=f_val1/f_val2;
 +    if(value>1) value=1;
-+    if(value<0) value=0;            
++    if(value<0) value=0;
 +    value*=((__u64)-1);
-+    
++
 +    // And find the value set
 +    if(!strcmp(name,"weight1"))    modf->weight1.val=value;
 +    else if(!strcmp(name,"decr1")) modf->weight1.decr=value;
@@ -1208,7 +1081,7 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +      fprintf(stderr,"illegal value: %s\n",name);
 +      return -1;
 +    }
-+  }    
++  }
 +
 +  return 0;
 +}
@@ -1218,57 +1091,57 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +  if(n->nlmsg_flags & NLM_F_CREATE) {
 +    // This is a create request:
 +    struct tc_wrr_qdisc_crt opt;
-+      
++
 +    int sour,dest,ip,mac,masq;
 +
 +    if(argc<4) {
 +      fprintf(stderr, "Usage: ... wrr sour|dest ip|masq|mac maxclasses proxymaxcon [penalty-setup]\n");
 +      return -1;
-+    }   
-+  
++    }
++
 +    // Read sour/dest:
 +    memset(&opt,0,sizeof(opt));
 +    sour=!strcmp(argv[0],"sour");
-+    dest=!strcmp(argv[0],"dest");     
-+      
++    dest=!strcmp(argv[0],"dest");
++
 +    if(!sour && !dest) {
 +      fprintf(stderr,"sour or dest must be specified\n");
 +      return -1;
-+    } 
++    }
 +
 +    // Read ip/mac
 +    ip=!strcmp(argv[1],"ip");
-+    mac=!strcmp(argv[1],"mac");       
-+    masq=!strcmp(argv[1],"masq");     
++    mac=!strcmp(argv[1],"mac");
++    masq=!strcmp(argv[1],"masq");
 +
 +    if(!ip && !mac && !masq) {
 +      fprintf(stderr,"ip, masq or mac must be specified\n");
 +      return -1;
-+    } 
++    }
 +
-+    opt.srcaddr=sour;         
++    opt.srcaddr=sour;
 +    opt.usemac=mac;
-+    opt.usemasq=masq;         
++    opt.usemasq=masq;
 +    opt.bands_max=atoi(argv[2]);
-+    
++
 +    opt.proxy_maxconn=atoi(argv[3]);
-+    
++
 +    // Read weights:
 +    if(wrr_parse_qdisc_weight(argc-4,argv+4,&opt.qdisc_modf)<0) return -1;
 +    if(opt.qdisc_modf.weight1.weight_mode==-1) opt.qdisc_modf.weight1.weight_mode=0;
 +    if(opt.qdisc_modf.weight2.weight_mode==-1) opt.qdisc_modf.weight2.weight_mode=0;
-+              
++
 +    addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
 +  } else {
 +    struct tc_wrr_qdisc_modf_std opt;
 +    char qdisc,class;
-+    
++
 +    // This is a modify request:
 +    if(argc<1) {
 +      fprintf(stderr,"... qdisc ... or ... class ...\n");
 +      return -1;
 +    }
-+            
++
 +    qdisc=!strcmp(argv[0],"qdisc");
 +    class=!strcmp(argv[0],"class");
 +
@@ -1276,20 +1149,20 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +      fprintf(stderr,"qdisc or class must be specified\n");
 +      return -1;
 +    }
-+      
++
 +    argc--;
 +    argv++;
-+      
++
 +    opt.proxy=0;
-+    
++
 +    if(qdisc) {
 +      opt.change_class=0;
 +      if(wrr_parse_qdisc_weight(argc, argv, &opt.qdisc_modf)<0) return -1;
 +    } else {
-+      int a0,a1,a2,a3,a4=0,a5=0;      
++      int a0,a1,a2,a3,a4=0,a5=0;
 +
 +      opt.change_class=1;
-+      
++
 +      if(argc<1) {
 +        fprintf(stderr,"... <mac>|<ip>|<masq> ...\n");
 +        return -1;
@@ -1301,13 +1174,13 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +      fprintf(stderr,"Wrong format of mac or ip address\n");
 +      return -1;
 +      }
-+      
++
 +      opt.addr[0]=a0; opt.addr[1]=a1; opt.addr[2]=a2;
 +      opt.addr[3]=a3; opt.addr[4]=a4; opt.addr[5]=a5;
 +
 +      if(wrr_parse_class_modf(argc-1, argv+1, &opt.class_modf)<0) return -1;
-+    }  
-+  
++    }
++
 +    addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
 +  }
 +  return 0;
@@ -1315,13 +1188,13 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +
 +static int wrr_parse_copt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) {
 +  struct tc_wrr_class_modf opt;
-+  
++
 +  memset(&opt,0,sizeof(opt));
 +  if(wrr_parse_class_modf(argc,argv,&opt)<0) return -1;
-+  
++
 +  addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
-+  return 0;  
-+}  
++  return 0;
++}
 +
 +static int wrr_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 +{
@@ -1333,20 +1206,20 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +      if (RTA_PAYLOAD(opt)  < sizeof(*qopt))
 +              return -1;
 +      qopt = RTA_DATA(opt);
-+      
++
 +      fprintf(f,"\n  (%s/%s) (maxclasses %i) (usedclasses %i) (reused classes %i)\n",
 +        qopt->qdisc_crt.srcaddr ? "sour" : "dest",
-+        qopt->qdisc_crt.usemac  ? "mac"  : (qopt->qdisc_crt.usemasq ? "masq" : "ip"),   
-+        qopt->qdisc_crt.bands_max,                      
++        qopt->qdisc_crt.usemac  ? "mac"  : (qopt->qdisc_crt.usemasq ? "masq" : "ip"),
++        qopt->qdisc_crt.bands_max,
 +        qopt->bands_cur,
 +        qopt->bands_reused
 +        );
-+        
++
 +      if(qopt->qdisc_crt.proxy_maxconn) {
 +        fprintf(f,"  (proxy maxcon %i) (proxy curcon %i)\n",
 +          qopt->qdisc_crt.proxy_maxconn,qopt->proxy_curconn);
 +      }
-+      
++
 +      fprintf(f,"  (waiting classes %i) (packets requeued %i) (priosum: %Lg)\n",
 +        qopt->nodes_in_heap,
 +        qopt->packets_requed,
@@ -1356,7 +1229,7 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +      fprintf(f,"  (wmode1 %i) (wmode2 %i) \n",
 +        qopt->qdisc_crt.qdisc_modf.weight1.weight_mode,
 +        qopt->qdisc_crt.qdisc_modf.weight2.weight_mode);
-+        
++
 +      return 0;
 +}
 +
@@ -1374,15 +1247,15 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +    fprintf(f,"(unused)");
 +    return 0;
 +  }
-+  
++
 +  if(copt->usemac) {
 +    fprintf(f,"\n  (address: %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)\n",
 +      copt->addr[0],copt->addr[1],copt->addr[2],
 +      copt->addr[3],copt->addr[4],copt->addr[5]);
-+  } else {     
++  } else {
 +    fprintf(f,"\n  (address: %i.%i.%i.%i)\n",copt->addr[0],copt->addr[1],copt->addr[2],copt->addr[3]);
-+  }    
-+  
++  }
++
 +  fprintf(f,"  (total weight: %Lg) (current position: %i) (counters: %u %u : %u %u)\n",
 +    (copt->class_modf.weight1.val/d)*(copt->class_modf.weight2.val/d),
 +    copt->heappos,
@@ -1391,7 +1264,7 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +    (unsigned)(copt->penal_ls>>32),
 +    (unsigned)(copt->penal_ls & 0xffffffffU)
 +    );
-+    
++
 +  fprintf(f,"  Pars 1: (weight %Lg) (decr: %Lg) (incr: %Lg) (min: %Lg) (max: %Lg)\n",
 +    copt->class_modf.weight1.val/d,
 +    copt->class_modf.weight1.decr/d,
@@ -1405,7 +1278,7 @@ diff -Nur iproute2-2.6.11-050330/tc/q_wrr.c iproute2-2.6.11-050330.new/tc/q_wrr.
 +    copt->class_modf.weight2.incr/d,
 +    copt->class_modf.weight2.min/d,
 +    copt->class_modf.weight2.max/d);
-+  
++
 +  return 0;
 +}
 +
This page took 0.052342 seconds and 4 git commands to generate.