act_skbmod.c (b409074e6693bcdaa7abbee2a035f22a9eabda53) | act_skbmod.c (4e8ddd7f1758ca4ddd0c1f7cf3e66fce736241d2) |
---|---|
1/* 2 * net/sched/act_skbmod.c skb data modifier 3 * 4 * Copyright (c) 2016 Jamal Hadi Salim <jhs@mojatatu.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 131 unchanged lines hidden (view full) --- 140 141 if (!exists) { 142 ret = tcf_idr_create(tn, parm->index, est, a, 143 &act_skbmod_ops, bind, true); 144 if (ret) 145 return ret; 146 147 ret = ACT_P_CREATED; | 1/* 2 * net/sched/act_skbmod.c skb data modifier 3 * 4 * Copyright (c) 2016 Jamal Hadi Salim <jhs@mojatatu.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 131 unchanged lines hidden (view full) --- 140 141 if (!exists) { 142 ret = tcf_idr_create(tn, parm->index, est, a, 143 &act_skbmod_ops, bind, true); 144 if (ret) 145 return ret; 146 147 ret = ACT_P_CREATED; |
148 } else { | 148 } else if (!ovr) { |
149 tcf_idr_release(*a, bind); | 149 tcf_idr_release(*a, bind); |
150 if (!ovr) 151 return -EEXIST; | 150 return -EEXIST; |
152 } 153 154 d = to_skbmod(*a); 155 156 ASSERT_RTNL(); 157 p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL); 158 if (unlikely(!p)) { | 151 } 152 153 d = to_skbmod(*a); 154 155 ASSERT_RTNL(); 156 p = kzalloc(sizeof(struct tcf_skbmod_params), GFP_KERNEL); 157 if (unlikely(!p)) { |
159 if (ret == ACT_P_CREATED) 160 tcf_idr_release(*a, bind); | 158 tcf_idr_release(*a, bind); |
161 return -ENOMEM; 162 } 163 164 p->flags = lflags; 165 d->tcf_action = parm->action; 166 167 p_old = rtnl_dereference(d->skbmod_p); 168 --- 143 unchanged lines hidden --- | 159 return -ENOMEM; 160 } 161 162 p->flags = lflags; 163 d->tcf_action = parm->action; 164 165 p_old = rtnl_dereference(d->skbmod_p); 166 --- 143 unchanged lines hidden --- |