Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271721

Re: [PATCH 5/5] netfilter: implement xt_cgroup2 match

From Jan Engelhardt <jengelh@inai.de>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] netfilter: implement xt_cgroup2 match
Date 2015-11-18 00:00 +0100
Message-ID <qvXoe-2MS-13@gated-at.bofh.it> (permalink)
References <qvUqm-TY-5@gated-at.bofh.it> <qvUqm-TY-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tuesday 2015-11-17 20:40, Tejun Heo wrote:
>@@ -0,0 +1,14 @@
>+#ifndef _XT_CGROUP2_H
>+#define _XT_CGROUP2_H
>+
>+#include <linux/types.h>
>+
>+struct xt_cgroup2_info {
>+	char				path[PATH_MAX];
>+	__u8				invert;

Should <linux/limits.h> be included? (For PATH_MAX)

>+	/* kernel internal data */
>+	void				*priv;
>+};

void *priv __attribute__((aligned(8)));

>+static bool cgroup2_mt(const struct sk_buff *skb, struct xt_action_param *par)
>+{
>+	const struct xt_cgroup2_info *info = par->matchinfo;
>+	struct cgroup *ancestor = info->priv;

There is no modification planned on the cgroup, so this too can be const struct
cgroup * if-and-when cgroup_is_descendant is made to take const ptrs as well.

>+	if (!skb->sk || !sk_fullsock(skb->sk))
>+		return false;
>+
>+	return cgroup_is_descendant(skb->sk->sk_cgroup, ancestor) ^ info->invert;
>+}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 5/5] netfilter: implement xt_cgroup2 match Tejun Heo <tj@kernel.org> - 2015-11-17 20:50 +0100
  Re: [PATCH 5/5] netfilter: implement xt_cgroup2 match Jan Engelhardt <jengelh@inai.de> - 2015-11-18 00:00 +0100

csiph-web