user539628
user539628

Reputation: 1

NetLink Message Memory Issue

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?

Upvotes: 0

Views: 1502

Answers (2)

user502515
user502515

Reputation: 4454

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

Upvotes: 1

Oleksandr Kravchuk
Oleksandr Kravchuk

Reputation: 6327

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.

Upvotes: 0

Related Questions