Netlink sockets problem in Fedora Core 8 2.6.23.1-42 Kernel
Hello ,
I am compiling a module for User - kernel interaction using netlink
sockets , I have my code ready , which ran on 2.4 series of kernels
about 2 years back.
i have to do the same for 2.6.XX series , i have the latest fedore 8
2.6.23 kernel .
The user space code compiled well , the kernel module is giving
trouble. with the following errors.
error : 'struct netlink_skb_parms' has no member named 'groups'
error : 'struct netlink_skb_parms' has no member named 'dst_pid'
error : 'struct netlink_skb_parms' has no member named 'dst_groups'
though this structure is well defined in netlink.h. The macro
NETLINK_CB (skb) is also well defined.
anybody here used netlink sockets on a 2.6.x.x machine?
Regards
Kartik saxena
Re: Netlink sockets problem in Fedora Core 8 2.6.23.1-42 Kernel
kartik saxena wrote:[color=blue]
> Hello ,
>
>
> I am compiling a module for User - kernel interaction using netlink
> sockets , I have my code ready , which ran on 2.4 series of kernels
> about 2 years back.
>
> i have to do the same for 2.6.XX series , i have the latest fedore 8
> 2.6.23 kernel .
> The user space code compiled well , the kernel module is giving
> trouble. with the following errors.
>
> error : 'struct netlink_skb_parms' has no member named 'groups'
> error : 'struct netlink_skb_parms' has no member named 'dst_pid'
> error : 'struct netlink_skb_parms' has no member named 'dst_groups'
>
> though this structure is well defined in netlink.h. The macro
> NETLINK_CB (skb) is also well defined.
>
> anybody here used netlink sockets on a 2.6.x.x machine?[/color]
Not directly... but udev communicates using netlink. Maybe you
can take a look at its source (?).
Re: Netlink sockets problem in Fedora Core 8 2.6.23.1-42 Kernel
Hello ,
Netlink Support has been withdrawn in 2.6.23 . I had checked kernel
configuration file , "make menuconfig" , I could not find netlink
installed. Is there any way to introduce the netlink support in the
new kernel , is this advisable?
OR
should I revert back to 2.6.11?
On Apr 22, 12:48*am, Chris Cox <ccox_nopenott...@airmail.net> wrote:[color=blue]
> kartik saxena wrote:[color=green]
> > Hello ,[/color]
>[color=green]
> > I am compiling a module for User - kernel interaction using netlink
> > sockets , I have my code ready , which ran on 2.4 series of kernels
> > about 2 years back.[/color]
>[color=green]
> > i have to do the same for 2.6.XX series , i have the latest fedore 8
> > 2.6.23 kernel .
> > The user space code compiled well , the kernel module is giving
> > trouble. with the following errors.[/color]
>[color=green]
> > error : 'struct netlink_skb_parms' has no member named 'groups'
> > error : 'struct netlink_skb_parms' has no member named 'dst_pid'
> > error : 'struct netlink_skb_parms' has no member named 'dst_groups'[/color]
>[color=green]
> > though this structure is well defined in netlink.h. *The macro
> > NETLINK_CB (skb) is also well defined.[/color]
>[color=green]
> > anybody here used netlink sockets on a 2.6.x.x machine?[/color]
>
> Not directly... but udev communicates using netlink. *Maybe you
> can take a look at its source (?).- Hide quoted text -
>
> - Show quoted text -[/color]
Re: Netlink sockets problem in Fedora Core 8 2.6.23.1-42 Kernel
kartik saxena <kartik.sxn@gmail.com> writes:[color=blue]
> Netlink Support has been withdrawn in 2.6.23 .[/color]
[rw@fever]~/build/linux/fever $strace ip ro 2>&1 | grep -i netlink
socket(PF_NETLINK, SOCK_RAW, 0) = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=7307, groups=00000000}, [12]) = 0
sendto(3, "\24\0\0\0\22\0\1\0039\21\17H\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\354\0\0\0\20\0\2\0009\21\17H\213\34\0\0\0\0\4\3\1\0\0"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 724
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0009\21\17H\213\34\0\0\0\0\0\0\1\0\0\0"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 20
sendto(3, "\24\0\0\0\32\0\1\3:\21\17H\0\0\0\0\2\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"<\0\0\0\30\0\2\0:\21\17H\213\34\0\0\2 \0\0\377\2\375\3"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 772
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0:\21\17H\213\34\0\0\0\0\0\0\377\2\375"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 20
[rw@fever]~/build/linux/fever $uname -a
Linux fever 2.6.25 #1 SMP Tue Apr 22 13:48:07 CEST 2008 i686 GNU/Linux
Aparently, the 'netlink character device' is gone, but this had been
declared obsolete before 2.2 was released (IIRC).
Re: Netlink sockets problem in Fedora Core 8 2.6.23.1-42 Kernel
On Apr 23, 3:38*pm, Rainer Weikusat <rweiku...@mssgmbh.com> wrote:
[color=blue]
> Aparently, the 'netlink character device' is gone, but this had been
> declared obsolete before 2.2 was released (IIRC).[/color]
Yes , I was basically using the netlink socket interface , not the
character device which is obsolete . The socket interface was
introduced in 2.2 linux kernels onwards.
I reverted back to , 2.6.11 kernel , and the module worked fine.
seems , the problem exists with 2.6.23 . I am a newbie , cant figure
out the error.
I have a question , If I want to somehow get the netlink socket
interface iworking nto the 2.6.23 kernel , what is the best approach
for it? Netlink.h the header file , has been reworked in the new
kernel . Recompiling a older version of the kernel seemed foolish to
me. I havent come across any "package" which installs itself.
Thanks for the support.
Re: Netlink sockets problem in Fedora Core 8 2.6.23.1-42 Kernel
kartik saxena <kartik.sxn@gmail.com> writes:[color=blue]
> On Apr 23, 3:38*pm, Rainer Weikusat <rweiku...@mssgmbh.com> wrote:[color=green]
>> Aparently, the 'netlink character device' is gone, but this had been
>> declared obsolete before 2.2 was released (IIRC).[/color]
>
> Yes , I was basically using the netlink socket interface , not the
> character device which is obsolete . The socket interface was
> introduced in 2.2 linux kernels onwards.
>
> I reverted back to , 2.6.11 kernel , and the module worked fine.
> seems , the problem exists with 2.6.23 . I am a newbie , cant figure
> out the error.
>
> I have a question , If I want to somehow get the netlink socket
> interface iworking nto the 2.6.23 kernel , what is the best approach
> for it? Netlink.h the header file , has been reworked in the new
> kernel.[/color]
Modify the other source code such that it works with the new header or
with both the new and the old header, as detected (or specified) at
compilation time.