act_csum.c (b409074e6693bcdaa7abbee2a035f22a9eabda53) act_csum.c (4e8ddd7f1758ca4ddd0c1f7cf3e66fce736241d2)
1/*
2 * Checksum updating actions
3 *
4 * Copyright (c) 2010 Gregoire Baron <baronchon@n7mm.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 62 unchanged lines hidden (view full) ---

71 ret = tcf_idr_create(tn, parm->index, est, a,
72 &act_csum_ops, bind, true);
73 if (ret)
74 return ret;
75 ret = ACT_P_CREATED;
76 } else {
77 if (bind)/* dont override defaults */
78 return 0;
1/*
2 * Checksum updating actions
3 *
4 * Copyright (c) 2010 Gregoire Baron <baronchon@n7mm.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 62 unchanged lines hidden (view full) ---

71 ret = tcf_idr_create(tn, parm->index, est, a,
72 &act_csum_ops, bind, true);
73 if (ret)
74 return ret;
75 ret = ACT_P_CREATED;
76 } else {
77 if (bind)/* dont override defaults */
78 return 0;
79 tcf_idr_release(*a, bind);
80 if (!ovr)
79 if (!ovr) {
80 tcf_idr_release(*a, bind);
81 return -EEXIST;
81 return -EEXIST;
82 }
82 }
83
84 p = to_tcf_csum(*a);
85 ASSERT_RTNL();
86
87 params_new = kzalloc(sizeof(*params_new), GFP_KERNEL);
88 if (unlikely(!params_new)) {
83 }
84
85 p = to_tcf_csum(*a);
86 ASSERT_RTNL();
87
88 params_new = kzalloc(sizeof(*params_new), GFP_KERNEL);
89 if (unlikely(!params_new)) {
89 if (ret == ACT_P_CREATED)
90 tcf_idr_release(*a, bind);
90 tcf_idr_release(*a, bind);
91 return -ENOMEM;
92 }
93 params_old = rtnl_dereference(p->params);
94
95 params_new->action = parm->action;
96 params_new->update_flags = parm->update_flags;
97 rcu_assign_pointer(p->params, params_new);
98 if (params_old)

--- 614 unchanged lines hidden ---
91 return -ENOMEM;
92 }
93 params_old = rtnl_dereference(p->params);
94
95 params_new->action = parm->action;
96 params_new->update_flags = parm->update_flags;
97 rcu_assign_pointer(p->params, params_new);
98 if (params_old)

--- 614 unchanged lines hidden ---