act_skbedit.c (14f0290ba44de6ed435fea24bba26e7868421c66) | act_skbedit.c (cc7ec456f82da7f89a5b376e613b3ac4311b3e9a) |
---|---|
1/* 2 * Copyright (c) 2008, Intel Corporation. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms and conditions of the GNU General Public License, 6 * version 2, as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope it will be useful, but WITHOUT --- 99 unchanged lines hidden (view full) --- 108 109 parm = nla_data(tb[TCA_SKBEDIT_PARMS]); 110 111 pc = tcf_hash_check(parm->index, a, bind, &skbedit_hash_info); 112 if (!pc) { 113 pc = tcf_hash_create(parm->index, est, a, sizeof(*d), bind, 114 &skbedit_idx_gen, &skbedit_hash_info); 115 if (IS_ERR(pc)) | 1/* 2 * Copyright (c) 2008, Intel Corporation. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms and conditions of the GNU General Public License, 6 * version 2, as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope it will be useful, but WITHOUT --- 99 unchanged lines hidden (view full) --- 108 109 parm = nla_data(tb[TCA_SKBEDIT_PARMS]); 110 111 pc = tcf_hash_check(parm->index, a, bind, &skbedit_hash_info); 112 if (!pc) { 113 pc = tcf_hash_create(parm->index, est, a, sizeof(*d), bind, 114 &skbedit_idx_gen, &skbedit_hash_info); 115 if (IS_ERR(pc)) |
116 return PTR_ERR(pc); | 116 return PTR_ERR(pc); |
117 118 d = to_skbedit(pc); 119 ret = ACT_P_CREATED; 120 } else { 121 d = to_skbedit(pc); 122 if (!ovr) { 123 tcf_hash_release(pc, bind, &skbedit_hash_info); 124 return -EEXIST; --- 14 unchanged lines hidden (view full) --- 139 140 spin_unlock_bh(&d->tcf_lock); 141 142 if (ret == ACT_P_CREATED) 143 tcf_hash_insert(pc, &skbedit_hash_info); 144 return ret; 145} 146 | 117 118 d = to_skbedit(pc); 119 ret = ACT_P_CREATED; 120 } else { 121 d = to_skbedit(pc); 122 if (!ovr) { 123 tcf_hash_release(pc, bind, &skbedit_hash_info); 124 return -EEXIST; --- 14 unchanged lines hidden (view full) --- 139 140 spin_unlock_bh(&d->tcf_lock); 141 142 if (ret == ACT_P_CREATED) 143 tcf_hash_insert(pc, &skbedit_hash_info); 144 return ret; 145} 146 |
147static inline int tcf_skbedit_cleanup(struct tc_action *a, int bind) | 147static int tcf_skbedit_cleanup(struct tc_action *a, int bind) |
148{ 149 struct tcf_skbedit *d = a->priv; 150 151 if (d) 152 return tcf_hash_release(&d->common, bind, &skbedit_hash_info); 153 return 0; 154} 155 | 148{ 149 struct tcf_skbedit *d = a->priv; 150 151 if (d) 152 return tcf_hash_release(&d->common, bind, &skbedit_hash_info); 153 return 0; 154} 155 |
156static inline int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a, 157 int bind, int ref) | 156static int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a, 157 int bind, int ref) |
158{ 159 unsigned char *b = skb_tail_pointer(skb); 160 struct tcf_skbedit *d = a->priv; 161 struct tc_skbedit opt = { 162 .index = d->tcf_index, 163 .refcnt = d->tcf_refcnt - ref, 164 .bindcnt = d->tcf_bindcnt - bind, 165 .action = d->tcf_action, --- 53 unchanged lines hidden --- | 158{ 159 unsigned char *b = skb_tail_pointer(skb); 160 struct tcf_skbedit *d = a->priv; 161 struct tc_skbedit opt = { 162 .index = d->tcf_index, 163 .refcnt = d->tcf_refcnt - ref, 164 .bindcnt = d->tcf_bindcnt - bind, 165 .action = d->tcf_action, --- 53 unchanged lines hidden --- |