[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161118123732.GA10400@salvia>
Date: Fri, 18 Nov 2016 13:37:32 +0100
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Daniel Mack <daniel@...que.org>
Cc: htejun@...com, daniel@...earbox.net, ast@...com,
davem@...emloft.net, kafai@...com, fw@...len.de, harald@...hat.com,
netdev@...r.kernel.org, sargun@...gun.me, cgroups@...r.kernel.org
Subject: Re: [PATCH v8 5/6] net: ipv4, ipv6: run cgroup eBPF egress programs
On Thu, Nov 17, 2016 at 07:27:08PM +0100, Daniel Mack wrote:
[...]
> @@ -312,6 +314,12 @@ int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb)
> skb->dev = dev;
> skb->protocol = htons(ETH_P_IP);
>
> + ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb);
> + if (ret) {
> + kfree_skb(skb);
> + return ret;
> + }
> +
> /*
> * Multicasts are looped back for other local users
> */
> @@ -364,12 +372,19 @@ int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb)
> int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb)
> {
> struct net_device *dev = skb_dst(skb)->dev;
> + int ret;
>
> IP_UPD_PO_STATS(net, IPSTATS_MIB_OUT, skb->len);
>
> skb->dev = dev;
> skb->protocol = htons(ETH_P_IP);
>
> + ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb);
> + if (ret) {
> + kfree_skb(skb);
> + return ret;
> + }
> +
> return NF_HOOK_COND(NFPROTO_IPV4, NF_INET_POST_ROUTING,
> net, sk, skb, NULL, dev,
> ip_finish_output,
Please, place this after the netfilter hook.
Since this new hook may mangle output packets, any mangling
potentially interfers and breaks conntrack.
Thank you.
Powered by blists - more mailing lists