On 02/07/2017 01:02 AM, Alexei Starovoitov wrote:
On 2/6/17 3:39 PM, Daniel Borkmann wrote:
On 02/04/2017 04:34 AM, Alexei Starovoitov wrote:
[...]
+BPF_CALL_1(bpf_skb_netns_id, struct sk_buff *, skb)
+{
+struct net_device *dev = skb->dev;
+
+if (!dev)
+return 0;
+return
On 2/6/17 3:39 PM, Daniel Borkmann wrote:
On 02/04/2017 04:34 AM, Alexei Starovoitov wrote:
[...]
+BPF_CALL_1(bpf_skb_netns_id, struct sk_buff *, skb)
+{
+struct net_device *dev = skb->dev;
+
+if (!dev)
+return 0;
+return proc_get_ns_devid_inum(_net(dev)->ns);
+}
+
+static
On 02/04/2017 04:34 AM, Alexei Starovoitov wrote:
[...]
+BPF_CALL_1(bpf_skb_netns_id, struct sk_buff *, skb)
+{
+ struct net_device *dev = skb->dev;
+
+ if (!dev)
+ return 0;
+ return proc_get_ns_devid_inum(_net(dev)->ns);
+}
+
+static const struct bpf_func_proto
On Sun, Feb 5, 2017 at 11:24 AM, David Ahern wrote:
> On 2/3/17 8:34 PM, Alexei Starovoitov wrote:
>> Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns
>> unique value that identifies netns of given socket or dev_net(skb->dev)
>> The upper 32-bits of the
On 2/3/17 8:34 PM, Alexei Starovoitov wrote:
> Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns
> unique value that identifies netns of given socket or dev_net(skb->dev)
> The upper 32-bits of the return value contain device id where namespace
> filesystem resides and lower
in cases where bpf programs are looking at sockets and packets
that belong to different netns, it could be useful to get an id
that uniquely identify a netns within the whole system.
Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns
unique value that identifies netns of given