Re: Netlink Socket: trouble while using netlink_broadcast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks you very much :-)
I will work on it today,  It will help me a lot !

Thierry



On Wed, Apr 22, 2009 at 4:09 AM, Prashant Bhole
<prashantsmailcenter@xxxxxxxxx> wrote:
> Hi,
> My mail didn't go to the mailing list because of its content. I am posting
> it again with code attached. It will help some other people having same
> problem.
>
> On Wed, Apr 22, 2009 at 7:05 AM, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote:
>>
>> nice work!!!! thank you for the sharing Prashant.
>>
>> On Wed, Apr 22, 2009 at 1:34 AM, Prashant Bhole
>> <prashantsmailcenter@xxxxxxxxx> wrote:
>> > Hi Thierry,
>> > I got the solution :) The only thing you are missing is to subscribe the
>> > group using setsockopt() just after bind() in the user space program.
>> > This
>> > subscription is necessary only when the group id is oher than 1. My code
>> > sends a message to kernel and then kernel replies to it using
>> > netlink_broadcast. I am using 2.6.26 kernel. And code is as follows:
>> >
>> > /*------------------------------ kernel module
>> > ----------------------------------*/
>> > #include <linux/init.h>
>> > #include <linux/module.h>
>> > #include <linux/kernel.h>
>>
>> >
>> >
>> > Thanks,
>> >
>> > On Fri, Apr 17, 2009 at 2:39 PM, Thierry <chocapiiic.tiery@xxxxxxxxx>
>> > wrote:
>> >>
>> >> Hi,
>> >>
>> >> it is always the same :'(
>> >> I have looked into kernel sources, and there is also somethings
>> >> strange: in source code of netlink_kernel_create:
>> >> if (group <32)
>> >>   group = 32;
>> >> This lines were not present in kernel 2.6.9.
>> >> I am also wondering if there isn't somethings wrong with listenners:
>> >> there are some tests on *has listenners*.
>> >>
>> >> Actually, I get theses errors:
>> >> For kernel code: netlink broadcast return -3, No such process.
>> >> User code: can't bind: errot -3.
>> >>
>> >> I have put one programs, who works when using unicast instead of
>> >> broadcast, GROUP_IB  set to 0, and I fix manually pid of the
>> >> user-level program.
>> >> When I changed unicast to broadcast, and I set GROUP_IB to an other
>> >> value, I get the errors.
>> >>
>> >>
>> >> Thierry
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > ~p~r~a~s~h~a~n~t~
>> >
>>
>>
>>
>> --
>> Regards,
>> Peter Teoh
>
>
>
> --
> ~p~r~a~s~h~a~n~t~
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux