]> git.pld-linux.org Git - packages/iproute2.git/blob - iproute2-htbupstreamfix.patch
- 2 upstream patches which fixes tc HTB:
[packages/iproute2.git] / iproute2-htbupstreamfix.patch
1 From 0a502b21e30be835dcad8d9c6023a41da8709eb1 Mon Sep 17 00:00:00 2001
2 From: Stephen Hemminger <stephen@networkplumber.org>
3 Date: Sun, 27 Oct 2013 19:26:47 +0000
4 Subject: Fix handling of qdis without options
5
6 Some qdisc like htb want the parse_qopt to be called even if no options
7 present. Fixes regression caused by:
8
9 e9e78b0db0e023035e346ba67de838be851eb665 is the first bad commit
10 commit e9e78b0db0e023035e346ba67de838be851eb665
11 Author: Stephen Hemminger <stephen@networkplumber.org>
12 Date:   Mon Aug 26 08:41:19 2013 -0700
13
14     tc: allow qdisc without options
15 ---
16 diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
17 index 3002a56..e304858 100644
18 --- a/tc/tc_qdisc.c
19 +++ b/tc/tc_qdisc.c
20 @@ -137,15 +137,16 @@ static int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
21         if (est.ewma_log)
22                 addattr_l(&req.n, sizeof(req), TCA_RATE, &est, sizeof(est));
23  
24 -       if (argc) {
25 -               if (q) {
26 -                       if (!q->parse_qopt) {
27 -                               fprintf(stderr, "qdisc '%s' does not support option parsing\n", k);
28 -                               return -1;
29 -                       }
30 +       if (q) {
31 +               if (q->parse_qopt) {
32                         if (q->parse_qopt(q, argc, argv, &req.n))
33                                 return 1;
34 -               } else {
35 +               } else if (argc) {
36 +                       fprintf(stderr, "qdisc '%s' does not support option parsing\n", k);
37 +                       return -1;
38 +               }
39 +       } else {
40 +               if (argc) {
41                         if (matches(*argv, "help") == 0)
42                                 usage();
43  
44 --
45 cgit v0.9.2
46 From 734c0ca2cabf96e2ac1abe6e1b0968d0b5b03b11 Mon Sep 17 00:00:00 2001
47 From: Stephen Hemminger <stephen@networkplumber.org>
48 Date: Sun, 27 Oct 2013 19:28:38 +0000
49 Subject: htb: remove old unused duplicate qdisc name
50
51 Alexey had htb2 as name for version in ancient code.
52 ---
53 diff --git a/tc/q_htb.c b/tc/q_htb.c
54 index 6737ddb..e108857 100644
55 --- a/tc/q_htb.c
56 +++ b/tc/q_htb.c
57 @@ -346,13 +346,3 @@ struct qdisc_util htb_qdisc_util = {
58         .parse_copt     = htb_parse_class_opt,
59         .print_copt     = htb_print_opt,
60  };
61 -
62 -/* for testing of old one */
63 -struct qdisc_util htb2_qdisc_util = {
64 -       .id             =  "htb2",
65 -       .parse_qopt     = htb_parse_opt,
66 -       .print_qopt     = htb_print_opt,
67 -       .print_xstats   = htb_print_xstats,
68 -       .parse_copt     = htb_parse_class_opt,
69 -       .print_copt     = htb_print_opt,
70 -};
71 --
72 cgit v0.9.2
This page took 0.082488 seconds and 3 git commands to generate.