Jonathan Khoo wrote:
Hi,
How about adding these lines...
len is the length of your data..
skb->len = sizeof(struct nlmsghdr) + len;
skb->tail = skb->data + skb->len;
skb->truesize = skb->len;
netlink_unicast (nl_sk, skb, pid, MSG_DONTWAIT);
Well .. actually the alloc_skb does set the (skb->tail, skb->truesize)
and more fields .. you can check the source of alloc_skb cause those
field are set differently that what is stated above
I only set skb->len = NLMSG_SPACE(pay_load_size) after calling alloc_skb
and everything is working.
so what is the right usage of it ?
MHD
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/