0

I am trying to send messages from user space to kernel. I am able to send it succesfully via netlink sockets. But I would like to know whether I should free the messages in kernel function which I have written or netlink socket API's are deallocating memory?

Also in /proc/net/netlink, I can see the Drop counts keep on increasing. What this count signifies?

2 Answers2

1

No. Your code must not free the skb inside the kernel; af_netlink.c will already do it.

user502515
  • 4,346
  • 24
  • 20
0

I don't get what you meant saying "free message". If you mean char variable with a message, then probably not. In typical situation, you have one variable for message storing, which you are permanently rewriting, so you don't free() this variable. If I understood you wrong, please show us your code.

/proc/net/netlink shows you the number of netlink messages drop due to overrun.

Oleksandr Kravchuk
  • 5,963
  • 1
  • 20
  • 31