lkml.org 
[lkml]   [2015]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: netlink: Add netlink_bound helper and use it in netlink_getname
Hello,

On Sun, Sep 27, 2015 at 03:49:16AM +0800, Herbert Xu wrote:
> If the autobind is not complete then netlink_getname must return
> zero rather than some garbage portid that belongs to somebody
> else's socket. That's what we did before any of this lockless
> code was introduced.
>
> If you don't check nlk->bound then you may return garbage.

Ah, yeah, you're right. We need to check that there because it may
contain a garbage value. I still think it'd better to use
netlink_bound() test in connect() too tho.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-09-26 22:01    [W:0.087 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site