On 27 November 2011 22:44, rohan puri <
rohan.puri15@gmail.com> wrote:
>
>
> On Sun, Nov 27, 2011 at 10:37 PM, Vimal <
j.vimal@gmail.com> wrote:
>>
>> Hi all,
>>
>> In the Linux networking code, I see a lot of comments that say "Must
>> be called with RTNL lock."
>>
>> What is this lock? I tried searching for it but couldn't find any
>> explanation on what it is...
>>
>> Thanks
>> --
>> Vimal
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>>
Kernelnewbies@kernelnewbies.org
>>
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> Hello Vimal,
> This is a mutex named rtnl_mutex. Refer file net/core/rtnetlink.c
> static DEFINE_MUTEX(rtnl_mutex);
>
> void rtnl_lock(void)
> {
> mutex_lock(&rtnl_mutex);
> }
> EXPORT_SYMBOL(rtnl_lock);
> Where ever you see those comments indicate that this mutex is to be held
> before execution of that code path.
> Regards,
> Rohan