I am trying send a list/array of struct to kernel space from userspace. Similar to Link As recommended there, I am thinking of using sockets for which i found link. Message is set hello in this line
strcpy(NLMSG_DATA(nlh), "Hello");
I tried
NLMSG_DATA(nlh) = my_list
That gave me error: lvalue required as left operand of assignment.
How can I change this to send an array/list using netlinks? If it can't be send this way, how else easily can I do this?
Update
My structure
typedef struct {
int val1;
int val2;
} mystruct;
I need to allocate an array/list of these in kernel memory so other system calls can access that list.