Skip to contentSkip to conversation

Can netlink_recvmsg not truncate messages unless asked to?

DISCUSSION David Howells 1 participant 1 message Apr 13, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Would it be feasible to make netlink_recvmsg() _not_ truncate message unless it is asked to by having MSG_TRUNC passed to it?

Unless netlink data packets are limited to PAGE_SIZE or less, it's entirely possible that the kernel can be in a situation where it can't guarantee to get a buffer large enough to receive a packet larger than that.

What I was trying to do was use recvmsg with MSG_PEEK to grab the nlmsghdr, and then using that to predict the size of the buffer I need. But that doesn't work because a packet might contain multiple netlink messages.

David