act_police.c (b409074e6693bcdaa7abbee2a035f22a9eabda53) | act_police.c (4e8ddd7f1758ca4ddd0c1f7cf3e66fce736241d2) |
---|---|
1/* 2 * net/sched/act_police.c Input police filter 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 97 unchanged lines hidden (view full) --- 106 return 0; 107 108 if (!exists) { 109 ret = tcf_idr_create(tn, parm->index, NULL, a, 110 &act_police_ops, bind, false); 111 if (ret) 112 return ret; 113 ret = ACT_P_CREATED; | 1/* 2 * net/sched/act_police.c Input police filter 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 97 unchanged lines hidden (view full) --- 106 return 0; 107 108 if (!exists) { 109 ret = tcf_idr_create(tn, parm->index, NULL, a, 110 &act_police_ops, bind, false); 111 if (ret) 112 return ret; 113 ret = ACT_P_CREATED; |
114 } else { | 114 } else if (!ovr) { |
115 tcf_idr_release(*a, bind); | 115 tcf_idr_release(*a, bind); |
116 if (!ovr) 117 return -EEXIST; | 116 return -EEXIST; |
118 } 119 120 police = to_police(*a); 121 if (parm->rate.rate) { 122 err = -ENOMEM; 123 R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE], NULL); 124 if (R_tab == NULL) 125 goto failure; --- 64 unchanged lines hidden (view full) --- 190 police->tcfp_t_c = ktime_get_ns(); 191 tcf_idr_insert(tn, *a); 192 193 return ret; 194 195failure: 196 qdisc_put_rtab(P_tab); 197 qdisc_put_rtab(R_tab); | 117 } 118 119 police = to_police(*a); 120 if (parm->rate.rate) { 121 err = -ENOMEM; 122 R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE], NULL); 123 if (R_tab == NULL) 124 goto failure; --- 64 unchanged lines hidden (view full) --- 189 police->tcfp_t_c = ktime_get_ns(); 190 tcf_idr_insert(tn, *a); 191 192 return ret; 193 194failure: 195 qdisc_put_rtab(P_tab); 196 qdisc_put_rtab(R_tab); |
198 if (ret == ACT_P_CREATED) 199 tcf_idr_release(*a, bind); | 197 tcf_idr_release(*a, bind); |
200 return err; 201} 202 203static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a, 204 struct tcf_result *res) 205{ 206 struct tcf_police *police = to_police(a); 207 s64 now; --- 164 unchanged lines hidden --- | 198 return err; 199} 200 201static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a, 202 struct tcf_result *res) 203{ 204 struct tcf_police *police = to_police(a); 205 s64 now; --- 164 unchanged lines hidden --- |