|
@@ -832,6 +832,11 @@ ctnetlink_alloc_filter(const struct nlattr * const cda[], u8 family)
|
|
|
{
|
|
|
struct ctnetlink_filter *filter;
|
|
|
|
|
|
+#ifndef CONFIG_NF_CONNTRACK_MARK
|
|
|
+ if (cda[CTA_MARK] && cda[CTA_MARK_MASK])
|
|
|
+ return ERR_PTR(-EOPNOTSUPP);
|
|
|
+#endif
|
|
|
+
|
|
|
filter = kzalloc(sizeof(*filter), GFP_KERNEL);
|
|
|
if (filter == NULL)
|
|
|
return ERR_PTR(-ENOMEM);
|
|
@@ -839,8 +844,10 @@ ctnetlink_alloc_filter(const struct nlattr * const cda[], u8 family)
|
|
|
filter->family = family;
|
|
|
|
|
|
#ifdef CONFIG_NF_CONNTRACK_MARK
|
|
|
- filter->mark.val = ntohl(nla_get_be32(cda[CTA_MARK]));
|
|
|
- filter->mark.mask = ntohl(nla_get_be32(cda[CTA_MARK_MASK]));
|
|
|
+ if (cda[CTA_MARK] && cda[CTA_MARK_MASK]) {
|
|
|
+ filter->mark.val = ntohl(nla_get_be32(cda[CTA_MARK]));
|
|
|
+ filter->mark.mask = ntohl(nla_get_be32(cda[CTA_MARK_MASK]));
|
|
|
+ }
|
|
|
#endif
|
|
|
return filter;
|
|
|
}
|