summaryrefslogtreecommitdiffstats
path: root/src/conntrack/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conntrack/api.c')
-rw-r--r--src/conntrack/api.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/conntrack/api.c b/src/conntrack/api.c
index a3cc061..f008f49 100644
--- a/src/conntrack/api.c
+++ b/src/conntrack/api.c
@@ -185,6 +185,12 @@ void nfct_callback_unregister(struct nfct_handle *h)
* @ct: pointer to a valid conntrack
* @type: attribute type
* @value: pointer to the attribute value
+ *
+ * Note that certain attributes are unsettable:
+ * - ATTR_USE
+ * - ATTR_ID
+ * - ATTR_*_COUNTER_*
+ * The call of this function for such attributes do nothing.
*/
void nfct_set_attr(struct nf_conntrack *ct,
const enum nf_conntrack_attr type,
@@ -196,8 +202,10 @@ void nfct_set_attr(struct nf_conntrack *ct,
if (type >= ATTR_MAX)
return;
- set_attr_array[type](ct, value);
- set_bit(type, ct->set);
+ if (set_attr_array[type]) {
+ set_attr_array[type](ct, value);
+ set_bit(type, ct->set);
+ }
}
/**