lkml.org 
[lkml]   [2017]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] net: inet: diag: expose sockets cgroup classid
Date
On Wed, Jul 26, 2017 at 03:01:32PM -0700, Cong Wang wrote:
>On Wed, Jul 26, 2017 at 10:22 AM, Levin, Alexander (Sasha Levin)
><alexander.levin@verizon.com> wrote:
>> + if (ext & (1 << (INET_DIAG_CLASS_ID - 1))) {
>> + u32 classid = 0;
>> +
>> +#ifdef CONFIG_SOCK_CGROUP_DATA
>> + classid = sock_cgroup_classid(&sk->sk_cgrp_data);
>> +#endif
>
>
>If CONFIG_SOCK_CGROUP_DATA is not enabled, should we put 0
>or put nothing (that is, skipping this nla_put())?

My logic was that if CONFIG_SOCK_CGROUP_DATA is disabled, then all sockets have the same default classid ==> 0, rather than having to deal with whether that config is enabled or not.

>> +
>> + nla_put(skb, INET_DIAG_CLASS_ID, sizeof(classid), &classid);
>
>nla_put_u32()

Will fix, thanks!

--

Thanks,
Sasha
\
 
 \ /
  Last update: 2017-07-27 01:01    [W:1.085 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site