Add SendMessagesScatter using conn.SendmsgBuffers#257
Add SendMessagesScatter using conn.SendmsgBuffers#257Cellebyte wants to merge 1 commit intomdlayher:mainfrom
Conversation
|
Do you have an example or test case that demonstrates the issue this change is intended to fix? |
|
No the change does not help with the issue alone. |
|
If you're using google/nftables and are trying to solve This PR is still useful IMO (not a maintainer) but I just didn't think it was the solution to the issue described in the title. |
|
Ok, I just saw your Issue and suggestion to add this method. I already use the latest commits in nftables:main on a cluster. Maybe we move the discussion to the right place and I add infos about the use-case and my Issue there as well as the reproducer and maybe some hint how I can debug it. |
10ef232 to
9f9bb1d
Compare
9f9bb1d to
b2e09e5
Compare
|
Changed the subject of this PR and implemented it as a separate function due to the mentioned issue above. |
| func (c *conn) SendMessagesScatter(messages []Message) error { | ||
| buffers := make([][]byte, len(messages)) | ||
| for i, m := range messages { | ||
| b, err := m.MarshalBinary() |
There was a problem hiding this comment.
I believe the issue discussed in google/nftables#350 now points to these buffers instead of the socket ones.
I think there is a limit on how many of these buffers you can use. Check getconf IOV_MAX
Add conn.SendmsgBuffers additionally of conn.Sendmsg
The library is used in a project which applies netfilter rules into network namespaces of containers.
Some customers use very huge netfilter configurations which cause a default socket configuration on linux to not accept the message. The project currently increases the socket buffer dynamically, based on the message size.
There was already #254 which got implemented here.
It is a separate function as suggested in #254, due to issues I had during a one to one replacement in gooogle/nftables.
This can only be merged after mdlayher/socket#18.